<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"></p>
<div style="font-size: 16px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="color: rgb(33, 33, 33); font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">Hi all,</span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: black; font-size: 12pt;"><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 14.67px;">I try to enable FEC in the encoder using the macro </span><span style="color: rgb(0, 0, 0); font-size: 14.67px;">OPUS_SET_INBAND_FEC</span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 14.67px;"> and </span><span style="font-size: 12pt; color: rgb(0, 0, 0);">I
set the packet loss percentage to a constant value of 30%</span><span lang="en-US" style="color: rgb(33, 33, 33); font-size: 12pt;"><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">using the macro </span></span><span style="color: rgb(0, 0, 0); font-size: 14.67px;">OPUS_SET_PACKET_LOSS_PERC</span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 14.67px;">.</span></span><span style="font-size: 12pt;"></span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0);"> </span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">Please find my encoder settings below:</span><span style="font-size: 12pt;"></span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<i><span style="color: rgb(0, 0, 0); font-size: 12pt;">opus: encoder fmtp (maxplaybackrate=8000;maxaveragebitrate=24000;sprop-stereo=1;cbr=1;useinbandfec=1;usedtx=1)</span></i><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<i><span style="color: rgb(0, 0, 0); font-size: 12pt;">opus: encode bw=narrow bitrate=24000 fch=auto vbr=0 fec=1 expected loss=30 dtx=1 complex=10</span></i><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="font-size: 12pt; color: rgb(0, 0, 0);"> </span><span style="font-size: 11pt; color: rgb(0, 0, 0);"> </span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">At the decoder side when a packet is lost I call the decoder with the next params:</span><span style="font-size: 12pt;"><span lang="en-US" style="color: rgb(112, 173, 71);"></span></span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<i><span style="color: black; font-size: 12pt;"><span style="color: rgb(0, 0, 0);">opus_decode(ads->dec, </span><b><span style="color: rgb(0, 0, 0);">NULL</span></b><span style="color: rgb(0, 0, 0);">, </span><b><span style="color: rgb(0, 0, 0);">0</span></b><span style="color: rgb(0, 0, 0);">,
sampv, (int)(*sampc/ads->ch), 0);</span></span></i><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">and set the</span><span lang="en-US" style="font-size: 12pt; color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0); font-size: 12pt;">flag packet_lost=true;</span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">When I receive</span><span style="font-size: 12pt;"><span style="color: rgb(0, 0, 0);"> </span><span lang="en-US" style="color: rgb(0, 0, 0);">the next</span></span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;"> </span><span style="color: rgb(0, 0, 0); font-size: 12pt;">packet</span><span lang="en-US" style="font-size: 12pt; color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0); font-size: 12pt;">I'm
trying to decode the packet with </span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">decode_</span><span style="color: rgb(0, 0, 0); font-size: 12pt;">fec = </span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">1</span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;"> </span><span style="color: rgb(0, 0, 0); font-size: 12pt;">and
then the same packet with </span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">decode_</span><span style="color: rgb(0, 0, 0); font-size: 12pt;">fec = </span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">0</span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">:</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="font-size: 12pt; color: rgb(0, 0, 0);"> </span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span lang="en-US" style="color: rgb(0, 0, 0);">In the code below, suggest to replace ‘ads->ch’ with ‘numChannels’ to make it more clear to what you refer to.)</span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if(packet_lost ) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if(opus_packet_has_fec(buf, (opus_int32)len, sample_rate)) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">fec_samples = opus_packet_get_samples_per_frame(buf, sample_rate);</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">info("opus: there is fec packets=%d\n", fec_samples);</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">n = opus_decode(</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">ads->dec,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">buf,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">(opus_int32)len,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">sampv,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">fec_samples,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">1);</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (n < 0) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">warning("opus: decode error: %s\n", opus_strerror(n));</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return EPROTO;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">n2 = opus_decode(</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">ads->dec,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">buf,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">(opus_int32)len,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: black; font-size: 12pt; font-family: Consolas, serif, EmojiFont;"><span style="color: rgb(0, 0, 0);">(opus_int16*)sampv + ( n * </span><span style="color: rgb(0, 0, 0); font-size: 14.67px; font-family: Calibri, sans-serif, serif, EmojiFont;">numChannels</span><span style="color: rgb(0, 0, 0);"> ),</span></span><span lang="en-US" style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: black; font-size: 12pt; font-family: Consolas, serif, EmojiFont;"><span style="color: rgb(0, 0, 0);">(int)(*sampc/</span><span style="color: rgb(0, 0, 0); font-size: 14.67px; font-family: Calibri, sans-serif, serif, EmojiFont;">numChannels</span><span style="color: rgb(0, 0, 0);">),</span></span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">0);</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (n2 < 0) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">warning("opus: decode error: %s\n", opus_strerror(n));</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 72pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return EPROTO;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 36pt;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">n = n + n2;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; text-indent: 36pt; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">But I feel no difference</span><span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span><span lang="en-US" style="color: rgb(0, 0, 0); font-size: 12pt;">in audio results with and without FEC</span><span style="color: rgb(0, 0, 0); font-size: 12pt;">.</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">This is the way I'm trying to understand whether there is FEC inside the packet:</span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">bool opus_packet_has_fec(const uint8_t* payload, size_t len, const int sample_rate)</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">{</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">int frames, channels, payload_length_ms;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">int n;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">opus_int16 frame_sizes[48];</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">const unsigned char *frame_data[48];</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (payload == NULL || len == 0) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">info("Empty payload!!\n");</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">/* In CELT_ONLY mode, packets should not have FEC. */</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (payload[0] & 0x80) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">info("CELT payload type!!\n");</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">payload_length_ms = opus_packet_get_samples_per_frame(payload, sample_rate) / 8;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">//payload_length_ms = opus_packet_get_samples_per_frame(payload, 48000) / 48;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (10 > payload_length_ms)</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">payload_length_ms = 10;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">channels = opus_packet_get_nb_channels(payload);</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">switch (payload_length_ms) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">case 10:</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">case 20: {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">frames = 1;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">break;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">case 40: {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">frames = 2;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">break;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">case 60: {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">frames = 3;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">break;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">default: {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false; // It is actually even an invalid packet.</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">/* The following is to parse the LBRR flags. */</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (opus_packet_parse(payload, (opus_int32)len, NULL,</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">frame_data, frame_sizes, NULL) < 0) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (frame_sizes[0] <= 1) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">for (n = 0; n < channels; n++) {</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1)))</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return true;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">return false;</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt; font-family: Consolas, serif, EmojiFont;">}</span><span style="color: black; font-size: 12pt;"></span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">The problem is that I feel no difference</span><span style="font-size: 12pt;"><span style="color: rgb(0, 0, 0);"> </span><span lang="en-US" style="color: rgb(0, 0, 0);">in audio quality</span></span><span style="color: rgb(0, 0, 0); font-size: 12pt;">.</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span lang="en-US" style="color: rgb(0, 0, 0);">Regardless of the actual packet loss rate (whether it is low - below 1% or high ~20%).</span></p>
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span lang="en-US" style="color: rgb(0, 0, 0);">We test by streaming a wav file that plays a constant ton and can hear audio ticks with and without FEC enabled.</span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;"> </span></p>
</div>
<div style="color: rgb(33, 33, 33); font-size: 15px; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont;">
<p style="font-size: 11pt; font-family: Calibri, sans-serif, serif, EmojiFont; margin-right: 0px; margin-left: 0px;">
<span style="color: rgb(0, 0, 0); font-size: 12pt;">Any ideas?</span></p>
</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<meta content="text/html; charset=UTF-8">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<div dir="ltr" style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; unicode-bidi:embed; margin:0px">
<font face="Calibri,sans-serif" size="2"><span dir="ltr" style="font-size:11pt"><font color="#1F497D">Best regards,</font></span></font></div>
<div dir="ltr" style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; unicode-bidi:embed; margin:0px">
<font face="Calibri,sans-serif" size="2"><span dir="ltr" style="font-size:11pt"><font color="#0070C0"><b>Dmitry Danilov</b></font></span></font></div>
<div dir="ltr" style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; unicode-bidi:embed; margin:0px">
<font face="Calibri,sans-serif" size="2"><span dir="ltr" style="font-size:11pt"><font color="#0070C0"><b>Senior Software Engineer</b></font></span></font></div>
<div dir="ltr" style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; unicode-bidi:embed; margin:0px">
<font face="Calibri,sans-serif" size="2"><span dir="ltr" style="font-size:11pt"><font size="2" color="#C45911"><span style="font-size:10pt">LiveU Ltd.</span></font><br>
</span></font></div>
<div dir="ltr" style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; unicode-bidi:embed; margin:0px">
<font face="Calibri,sans-serif" size="2"><span dir="ltr" style="font-size:11pt"><font size="2" color="#595959"><span style="font-size:10pt">Email: </span></font><a href="mailto:dmitry@liveu.tv" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span style="font-size:10pt"><font color="#595959">dmitry@liveu.tv</font></span></font></a></span></font></div>
<p></p>
</div>
</div>
</div>
</body>
</html>