<div dir="ltr"><div>Hello, <br></div><div><br></div><div>I've been trying to understand how to use opus codec for quite some time. There is a thing that doesn't make sense to me. I will try to explain what it is below,</div><div><br></div><div>In <b>opus_encode() </b>function, <b>opus_int16 pcm</b> is said to have a size of <b>frame_size * channels</b>, where <b>frame_size</b> is said to be one of<b> 20, 240, 480, 960, 1920, and 2880.</b></div><div>Let's say, frame_size is 960, then opus_int16 pcm's size in bytes would be <span id="m_5372245715281859124gmail-cwos"><b>3840</b>. Documentation page says the recommended size for <b>output payload </b>should be around <b>4000.<br></b></span></div><div><span id="m_5372245715281859124gmail-cwos">I check the return values returned by <b>opus_encode(), </b>and they are between 250 and 300, which is the length of the encoded packet.</span></div><div><span id="m_5372245715281859124gmail-cwos"><br></span></div><div><span id="m_5372245715281859124gmail-cwos">Now, we are supposed to send <b>ouput_payload</b> - which is 4000 bytes long - over the network. That means sending more bytes than sending opus_int16 pcm, which is length of <b>3840 </b>in bytes<b>.</b><br></span></div><div><span id="m_5372245715281859124gmail-cwos">So what is the advantage of encoding the data if we are to send more bytes than initially held?<br></span></div><div><span id="m_5372245715281859124gmail-cwos"><br></span></div><div><span id="m_5372245715281859124gmail-cwos">I also tried setting <b>output payload's </b>size to be one of <b>512, 256, 128 </b>bytes<b> </b>and all seemed to work fine. I understand when <b>output payload</b> is shorter than <b>opus_int16  pcm</b> in size but don't understand when it is bigger.<br></span></div><div><span id="m_5372245715281859124gmail-cwos"><br></span></div><div><span id="m_5372245715281859124gmail-cwos">Best Regards,<br></span></div><div><span id="m_5372245715281859124gmail-cwos"><b></b></span></div><div><span id="m_5372245715281859124gmail-cwos"><br></span></div><div><br></div></div>