<div dir="ltr">Sorry, forgot to cc the opus mailing list...<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">What is the difference between Ogg-encapsulated Opus packets vs Raw packets?</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> </blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"> </blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">How does one generate one or the other programmatically? </blockquote><div><br></div><div>- Juan </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 9:30 AM Juan Gerardo Ruelas Jr <<a href="mailto:jruel006@ucr.edu">jruel006@ucr.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">What is the difference between Ogg-encapsulated Opus packets vs Raw packets?<br><br>How does one generate one or the other programmatically? <br><br>- Juan</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 2:10 AM Emily Bowman <<a href="mailto:silverbacknet@gmail.com" target="_blank">silverbacknet@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Small correction, I just realized while re-reading this that where I said raw Opus packets, I should have said Ogg-encapsulated Opus packets, which is at least a much simpler format than MP4. Raw packets are useful in some contexts but more awkward to work with.<br></div><div><br></div><div>- Em<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 12:15 AM Emily Bowman <<a href="mailto:silverbacknet@gmail.com" target="_blank">silverbacknet@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Since everything goes back to the C library anyway (or a variant of it, if you use, say, emscripten), you're free to use any language you want to interface with the API. Third-parties have created wrappers for a number of other languages, like Python, since C is a simple and universal binding.</div><div><br></div><div>While most web streams use chunking via DASH these days, which involves encapsulating packets in ISO-BMFF (MP4), you're perfectly free to just send raw Opus packets sliced up and the decoder will handle them gracefully. Even if packets are lost and you have no error correction, the decoding will resynchronize within one packet, and sound a lot less ugly than the chirps you get with many other codecs. That was a specific design goal of the format. The format on disk is exactly identical to the streamed format, so just concatenating the received packets is a valid and simple way to save to disk.</div><div><br></div><div>For a basic example of using the API from C/C++, check out <a href="https://opus-codec.org/docs/opus_api-1.3.1/group__opus__encoder.html" target="_blank">https://opus-codec.org/docs/opus_api-1.3.1/group__opus__encoder.html</a> . There's a bit of boilerplate to initialize it, but not too much, and from there you can broadcast the encoded packets however you like. DASH is much more complex, though if you have a library for your platforms of choice it'll either support Opus natively or be fairly simple to retrofit in.<br></div><div><br></div><div>-Em<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 2, 2020 at 5:36 PM Juan Gerardo Ruelas Jr <<a href="mailto:jruel006@ucr.edu" target="_blank">jruel006@ucr.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am interested in using the opus codec to stream audio files to a mobile app. <br><br>I have a couple of questions about how to get started? <br><ol><li>How do I generate opus files programmatically with C++? What inputs does it need? Is there a special file format because all the examples I see only have .wav files as inputs. <br></li><li>Does opus support chunking? For example, breaking a 24 hour long audio into a series of sequential smaller files (say 5 seconds long) to stream them down to a user? <br></li><li>Does opus support stitching together opus files? Say, after a user receives the 5 second long stream, can I programmatically stitch the files together as they come so as to save the entire 24 hour long audio file for offline use at a later time?</li><li>How do you stream these files programmatically? What is the general approach. Can you do it with node.js? C++? Python? What is most efficient? <br><br>p.s. (when I say audio files I generally mean just voice audio like in audio books)<br><br></li></ol>Thank you for your help, I am honestly confused as to how to get started. <br><div><br>- Juan Gerardo Ruelas Jr.  </div></div>
_______________________________________________<br>
opus mailing list<br>
<a href="mailto:opus@xiph.org" target="_blank">opus@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/opus" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/listinfo/opus</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>