fast-engineer-40129
11/27/2025, 12:22 PMtall-airline-16756
11/27/2025, 12:22 PMtall-airline-16756
11/27/2025, 12:23 PMfast-engineer-40129
11/28/2025, 7:20 AMtall-airline-16756
11/28/2025, 7:20 AMnoiseSuppression, echoCancellation, autoGainControl, or LiveKit’s NC features).
• A short recorded example: one 10–20s sample of the original bg file plus a recorded capture of the egress audio where the breaking is audible.
Quick tests you can run and report results for:
• Play the same bg file into a plain LiveKit-to-LiveKit peer (no SIP) and confirm whether you hear breaks there.
• Publish the bg track with autoGainControl, noiseSuppression, and echoCancellation toggled off, then test egress again.
• Publish a constant tone (sine wave) instead of the bg audio to see if the breaking persists.
Send me the answers and the short audio samples and I’ll analyze them and recommend the next steps (specific settings or a targeted reproduction I can walk you through).fast-engineer-40129
11/28/2025, 7:25 AMautoGainControl, noiseSuppression, and echoCancellation with these options i cannot find them in python sdk.
3. the codec being used is G722 on the telephony end, we send audio to livekit as pcm bytes.
4. I am on 1.0.18
5. Attached example audiotall-airline-16756
11/28/2025, 7:26 AMautoGainControl, noiseSuppression, or echoCancellation when publishing from the Python/server SDK. Those are client-side capture options (browser/mobile). For server-side publishing, focus on the PCM input you feed LiveKit.
2) Likely root cause given your clues
• G.722 on the SIP leg is sensitive to sample rate, frame alignment, and packet timing. If PCM frames are mis-sized, misaligned, or inconsistent, transcoding/packetization to G.722 can produce the choppy egress you hear — even if LiveKit-to-LiveKit is fine.
3) Concrete checks and fixes to try now
• Ensure PCM format: 16-bit signed little-endian (S16LE), mono, sample rate matching what you create in AudioSource.
• Use 16 kHz for G.722. Set AudioSource sample rate to 16000 and publish frames that match this.
• Send consistent frame durations (10ms or 20ms). For 20ms at 16 kHz: 320 samples → 640 bytes per frame (S16LE mono). Align every capture_frame to this boundary.
• If you’re injecting raw PCM, try switching to a WAV file or the BackgroundAudioPlayer (which handles proper framing/decoding) and re-test.
• Try publishing a constant tone (sine) at low level for 10–20s; if that still chops, it points to timing/packetization rather than content.
4) What I need from you to continue diagnosing
• Confirm the PCM specs you’re sending (sample rate, channels, bit depth, endianness) and an example of code (how you create AudioSource and call capture_frame).
• Confirm whether you already send 20ms-aligned frames and their exact byte size.
• I can analyze the attached example — please confirm the attached file is the original PCM you send (S16LE @16k) and also provide the recorded egress capture if you have it.
If you want, share the code snippet that creates the AudioSource and the capture_frame loop and I’ll point out any specific changes to ensure proper framing and timing.
Sources: SIP overview | LiveKit docs | Camera & microphone | LiveKit docs | Agent speech and audio | LiveKit docs | Codecs and more | LiveKit docs