siprec icon indicating copy to clipboard operation
siprec copied to clipboard

Noise in Recorded Files / No Audio

Open kingster opened this issue 9 months ago • 5 comments

Hi

Recorded Audio Files has just noise, no hearable audio. Sample : 8883e35bc982d07290c9da7ebfa3851b.wav

App Logs for the Call app_logs.txt

Call SDP

v=0
o=- 1795903 1 IN IP4 192.16.12.69
s=-
c=IN IP4 192.16.12.191
t=0 0
m=audio 38048 RTP/AVP 18 0 8 127
a=rtpmap:18 G729/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=label:20
a=sendonly
a=ptime:20
m=audio 38050 RTP/AVP 18 0 8 127
a=rtpmap:18 G729/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=label:10
a=sendonly
a=ptime:20

kingster avatar Feb 26 '26 04:02 kingster

Looking into it.

loreste avatar Feb 26 '26 14:02 loreste

The audio has 65% clipped samples - that's the issue. The G.729 decoder is producing values that overflow

loreste avatar Feb 26 '26 14:02 loreste

Going to fix that now

loreste avatar Feb 26 '26 14:02 loreste

I should have tested that yesterday, not really using g729 in production. Thanks for identifying this.

loreste avatar Feb 26 '26 14:02 loreste

Hi @voiceip,

Thank you for the detailed report and especially for providing the audio sample - that was incredibly helpful for diagnosing the issue!

The root cause was identified: the G.729 decoder's fixed codebook gain values were set too high, causing the synthesized audio to exceed the 16-bit PCM range and get hard-clipped. This resulted in the noise and distortion you observed (the sample had about 65% of its samples hitting the clipping limits).

The fix (commit d386c27) addresses this by:

  1. Reducing the gain table values to proper levels matching G.729 specifications
  2. Implementing adaptive output scaling that dynamically adjusts based on peak amplitude, ensuring the output stays within proper bounds with headroom

The fix has been deployed to production. Future G.729 recordings should sound clear without the clicking/distortion artifacts.

Thanks again for helping improve the project!

loreste avatar Feb 26 '26 14:02 loreste