I try to create a simple Python Demo app where I take audio from mic, send to Retell AI and play audio response.
I enabled background noice and I get it and can listen.
But I have a problem with sending audio, because if I enable audio sending, connection fails after 3-4 seconds with:
Received error in on_error: Connection to remote host was lost.
Debugging info
history=198b3d3180eab872183c56e97c6e1ca8
Audio websocket started: 198b3d3180eab872183c56e97c6e1ca8 web
2024-06-24 22:22:21.629 error: Audio websocket closed in error: 1006
2024-06-24 22:22:21.629 info: Ending audio websocket: 198b3d3180eab872183c56e97c6e1ca8
I attached my code, API key is removed due to security reasons.
I tried different buffer sizes and audio rates.
Would appreaciate any help and would suggest to add an example in docs for websocket connection in Python.