<p dir="ltr">Opus always uses 48khz </p>
<div class="gmail_quote">On Aug 1, 2013 2:15 PM, &quot;Dimosthenis  Arkoudeas&quot; &lt;<a href="mailto:dimosthenis@arkoudeas.com">dimosthenis@arkoudeas.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div lang="EL" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span lang="EN-US">Hi all,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Playing with mod_opus came up with the following.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am trying to recompile the codec with 8Khz and 40ms ptime. I am not familiar with the codec internals and not really sure what parameters should I change…<u></u><u></u></span></p>

<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">In mod_opus.c :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Line 59:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">int bitrate_bps = codec-&gt;implementation-&gt;bits_per_second;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                int use_vbr = 1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                int complexity = 10;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                int use_inbandfec = 1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                int use_dtx = 1;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                int bandwidth = OPUS_BANDWIDTH_FULLBAND;<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">                </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">int err;<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">I suppose that the bandwidth must be changed to OPUS_BANDWIDTH_NARROWBAND and use_vbr=0 and I haven’t found yet whether the FEC parameter is passed
 to opus encoder.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">And in Line 184 , I think the following parameters must be changed<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<pre><span lang="EN-US"> </span><span><span lang="EN-US">switch_codec_interface_t</span></span><span lang="EN-US"> *</span><span><span lang="EN-US">codec_interface</span></span><span lang="EN-US">;<u></u><u></u></span></pre>

<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">samples</span></span><span lang="EN-US"> = <span>480</span>;<u></u><u></u></span></pre>
<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">bytes</span></span><span lang="EN-US"> = <span>960</span>;<u></u><u></u></span></pre>
<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">mss</span></span><span lang="EN-US"> = <span>10000</span>;<u></u><u></u></span></pre>
<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">x</span></span><span lang="EN-US"> = <span>0</span>;<u></u><u></u></span></pre>
<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">rate</span></span><span lang="EN-US"> = <span>48000</span>;<u></u><u></u></span></pre>
<pre><span lang="EN-US">        <span>int</span> </span><span><span lang="EN-US">bits</span></span><span lang="EN-US"> = <span>32000</span>;<u></u><u></u></span></pre>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Can you propose any values about these parameters to achieve 8khz with 40ms packet time?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks for any help,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Dimosthenis<u></u><u></u></span></p>
</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>