Because if a RTP packet is due and hasn't arrived yet you need something to play. Audio isn't like TCP where you dropped packets can be retransmitted, if it hasn't arrived by the time you want to play it it's too late and you have to play silence to handle it.<div>
<br></div><div>Your audio problems are more likely due to packet loss or jitter which is why the RTP packet is overdue, not the CNG itself.</div><div><br></div><div>It jitter's the problem enabling the jitterbuffer might help (at the expense of increased lag). If loss is the problem there's no way to handle that except as silence for the missing interval, you need to fix whatever is causing the loss.</div>
<div><br></div><div>-Steve</div><div><br></div><div><br><div class="gmail_quote">On 5 February 2013 10:23, Xijing Dai <span dir="ltr"><<a href="mailto:dxj19831029@gmail.com" target="_blank">dxj19831029@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey all,<div><br></div><div><br></div><div>Inside code</div><div><br></div><div>switch_rtp.c file:</div><div><br></div>
<blockquote> static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags)<br>
................<br> if (check || (bytes && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER))) {<br><span style="white-space:pre-wrap">                        </span>if (!bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) {<span style="white-space:pre-wrap">        </span>/* We're late! We're Late! */<br>
<span style="white-space:pre-wrap">                                </span>if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) {<br><span style="white-space:pre-wrap">                                        </span>switch_cond_next();<br>
<span style="white-space:pre-wrap">                                        </span>continue;<br><span style="white-space:pre-wrap">                                </span>}<br><span style="white-space:pre-wrap">                                <br></span><span style="white-space:pre-wrap">                                </span>return_cng_frame(); <------- this lane to return cng frame if late.<br>
<span style="white-space:pre-wrap">                        </span>}<br><span style="white-space:pre-wrap">                </span>}<br><br><br></blockquote>Could someone explain why we want to return cng frame when package is late? this is caused for me to hear very bad noise audio.<div>
<br></div><div>Can I disable return CNG frame?<br><div><br></div><div><br></div><div>Cheers<br><blockquote><br><br><br><br></blockquote></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>