SlaviSavanovic
03/27/2025, 4:44 AMVapi Support Bot
03/27/2025, 4:45 AMlistenUrl
which allows you to connect to a WebSocket and stream audio data in real-time. According to the [Vapi documentation](https://docs.vapi.ai/calls/call-features), you can obtain the listenUrl
by triggering a /call
endpoint, which returns it within the monitor
object.
### Handling Audio Decoding Issues
One common issue when streaming audio to browsers is encountering an "EncodingError: Unable to decode audio data." A solution that has worked for others is using an audioworklet processor. There's a GitHub repository that might help: [LIVE-LISTEN](https://github.com/esplanadeai/LIVE-LISTEN) which was recommended in a [Discord thread](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1335246255705690265) for someone with similar issues.
### Converting Audio from Buffer
For live call audio, you'll need to formulate the audio from a buffer. The [Vapi documentation](https://docs.vapi.ai/calls/call-features#example-saving-audio-data-from-a-live-call) provides an example of getting live call audio in realtime using websockets which you can then convert into audio from a buffer.
### Audio Processing Configuration
Certain configuration settings might affect the quality of your live call audio. Settings like voicemailDetectionEnabled
, backchannelingEnabled
, and backgroundDenoisingEnabled
could influence playback quality according to a [Discord discussion](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1340031852819251384).
### Real-time Audio Streaming ConsiderationsVapi Support Bot
03/27/2025, 4:45 AMKyle Brunker
03/27/2025, 11:44 PMSlaviSavanovic
04/01/2025, 7:42 PMSlaviSavanovic
04/01/2025, 7:42 PMKyle Brunker
04/06/2025, 12:37 PM