Listen to live audio
# support
n
I am trying to create a listen live button for my application, but I am facing an issue where the sound is distorted, heavy or breaking up. Below is what I did so far: Key Implementation Details: We're receiving binary PCM data via WebSocket Converting Int16 PCM data to Float32Audio (-1 to 1 range) Processing audio in small chunks (2048 samples) for smoother playback Using a compressor to manage dynamic range Implementing proper cleanup of audio resources Handling WebSocket connection states and errors The main issues we're experiencing: Audio distortion despite scaling and compression Possible latency issues It would be helpful if Vapi could confirm: The exact format of the PCM data being sent The expected sample rate and bit depth Whether the WebSocket is sending data at a consistent rate Are there any specific client-side settings you recommend for the audio stream?
s
Hey @Nektarios - PCM data: Signed 16-bit little-endian PCM (S16LE). - Sample rate is 16,000 Hz, bit depth is 16-bit. - The WebSocket sends data at a consistent rate based on the pipeline design. - Ensure proper handling of the 16,000 Hz sample rate and 16-bit PCM format on the client side.
Because of no response closing this ticket.