I am trying to make work a simple transcription with IBM Watson using python:
import json
from os.path import join, dirname
from ibm_watson import SpeechToTextV1
from ibm_watson.websocket import RecognizeCallback, AudioSource
import threading
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator('myAPIKey')
service = SpeechToTextV1(authenticator=authenticator)
service.set_service_url('myURLendPoint')
#service.set_disable_ssl_verification(True)
with open('C:\\path\\myaudio.flac',
'rb') as audio_file:
speech_recognition_results = service.recognize(
audio=audio_file,
content_type='audio/flac',
).get_result()
print(json.dumps(speech_recognition_results, indent=2))
but it does not work. I got this error:
ApiException: Error: <HTML><HEAD>
<TITLE>Internal Server Error</TITLE>
</HEAD><BODY>
<H1>Internal Server Error - Write</H1>
The server encountered an internal error or misconfiguration and was unable to
complete your request.<P>
Reference #4.e0a33617.1636132745.598fc
</BODY></HTML>
, Code: 503
Any idea on what I am doing wrong..? I am following IBM docs..