I am trying to have create WAV on ITU G.711 mu-law, mono 8 khz format but they are coming out silent:
def text_to_speach(text, audio_voice, output_file):
"""
Converts Text to speach using IBM Watson
"""
apikey = <mykey>
url = <myURL>
# Setup Service
authenticator = IAMAuthenticator(apikey)
tts = TextToSpeechV1(authenticator=authenticator)
tts.set_service_url(url)
with open(output_file, "wb") as audio_file:
res = tts.synthesize(text, accept="audio/mulaw;rate=8000", voice=audio_voice).get_result()
audio_file.write(res.content)
print("Done!!!")
Please advise.
question from:https://stackoverflow.com/questions/65945550/ibm-watson-text-to-spech-wave-codec