I have a websocket in python Flask that listens to a twilio call. When the call is started I want to say "hello" here is the code.
if data['event'] == "start":
speakBytes = speaker.speak("Hello") // using micrsoft cognitive service to convert the text to bytes
convertedBytes = ap.lin2ulaw(speakBytes.audio_data,1)
ws.send(responseString.format(base64.b64encode(convertedBytes), str(data['streamSid'])))
But the above is not working. I checked microsoft cognitive services speech sunthesizer returns the bytes in WAV format so I have used lin2ulaw
form python audioop
module.
Need help. Thanks in advance.