[opus] Decoding Opus File in Chunks

Chris McGowan chris at anthum.com
Fri Apr 6 16:08:11 UTC 2018

I would like to decode an Opus file in chunks (e.g. 16K byte array).  Is
this possible with the Opusfile library or would I need to interface
directly with libogg and libopus?  It seems like the Opusfile decoder
functions maintain an internal pointer/state for OggOpusFile during
multiple calls to op_read(OggOpusFile *_op ...) and a complete byte array
of the entire Opus file would be needed.

Any help in pointing me in the right direction would be greatly
appreciated.  Due to the nature of the chunks coming in and the need to
obtain/assemble Opus packets before decoding, I'm aware that some
buffering/assembly of the chunks may be needed, but I'm hoping to achieve
this with a high-level API if possible.  I'm new to C, and this is for an
educational WebAssembly demo for the web community.

I've successfully compiled opusfile and have been playing with the
opusfile_example.c file, but those examples seem to be for complete files
only.  I cannot use the native HTTP decoding features because of the need
to process byte array chunks for this demo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20180406/7174dddd/attachment.html>

More information about the opus mailing list