Hi all, I am a developer for embedded system and totally new to Opus and open source audio codec. I'm now using Microchip dsPIC33 to develop a decoder for Opus. I am now using sources of libopus. The first question is for calling opus_decode(), do I need to skip the header bytes of an opus file before I can input the file data to opus_decode()? Or will libopus handle this automatically? Actually I have browsed through the site, but there is nothing detail talking about the header bytes of opus file. When I compare two opus files by hex viewer I can identify the header portion, but have no clue how each packet is allocated. BTW, I know libopusfile is solely for decoding and should be more convenience for my application. However, the .a files are not compatible with Microchip compiler. Does anyone have any good suggestion? Thx!!! BR H.K. Wong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20130430/ec0f58ff/attachment.htm
Timothy B. Terriberry
2013-Apr-30 05:25 UTC
[opus] How to identify packets to input to opus_decode()
HK Wong wrote:> for Opus. I am now using sources of libopus. The first question is for > calling opus_decode(), do I need to skip the header bytes of an opus > file before I can input the file data to opus_decode()? Or will libopus > handle this automatically?You need to feed libopus distinct packets, and you need to parse out the size of those packets from the file first. This is not handled automatically by libopus (that is what libopusfile is for).> Actually I have browsed through the site, but there is nothing detail > talking about the header bytes of opus file. When I compare two opus > files by hex viewer I can identify the header portion, but have no clue > how each packet is allocated.You can find details on the headers here: http://tools.ietf.org/html/draft-ietf-codec-oggopus Most of the details of the Ogg layer that encapsulates Opus packets is found here: http://tools.ietf.org/html/rfc3533> BTW, I know libopusfile is solely for decoding and should be more > convenience for my application. However, the .a files are not compatible > with Microchip compiler.The source code of libopusfile is here: http://git.xiph.org/?p=opusfile.git I don't know anything about your environment, but you should be able to compile your own library from the source files there.
HK Wong wrote:>* for Opus. I am now using sources of libopus. The first question is for*>* calling opus_decode(), do I need to skip the header bytes of an opus*>* file before I can input the file data to opus_decode()? Or will libopus*>* handle this automatically?*You need to feed libopus distinct packets, and you need to parse out the size of those packets from the file first. This is not handled automatically by libopus (that is what libopusfile is for). So each libopus packet begins by a TOC byte as stated in RFC6716? And the no. of bytes of each packet usually denoted by the segment table entries in the ogg layer? If the TOC byte is also needed to feed into libopus?>* Actually I have browsed through the site, but there is nothing detail*>* talking about the header bytes of opus file. When I compare two opus*>* files by hex viewer I can identify the header portion, but have no clue*>* how each packet is allocated.*You can find details on the headers here:http://tools.ietf.org/html/draft-ietf-codec-oggopus Most of the details of the Ogg layer that encapsulates Opus packets is found here:http://tools.ietf.org/html/rfc3533>* BTW, I know libopusfile is solely for decoding and should be more*>* convenience for my application. However, the .a files are not compatible*>* with Microchip compiler.*The source code of libopusfile is here:http://git.xiph.org/?p=opusfile.git I don't know anything about your environment, but you should be able to compile your own library from the source files there. And for libopusfile, it needs to run with libopus and also libogg? And is this (http://downloads.xiph.org/releases/ogg/libogg-1.3.0.zip) the download link for libogg? BR H.K. Wong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20130430/7d6fc52b/attachment-0001.htm
**>You need to feed libopus distinct packets, and you need to parse out the>size of those packets from the file first. This is not handled>automatically by libopus (that is what libopusfile is for). So each libopus packet begins by a TOC byte as stated in RFC6716? And the no. of bytes of each packet usually denoted by the segment table entries in the ogg layer? If the TOC byte is also needed to feed into libopus?>The source code of libopusfile is here:http://git.xiph.org/?p=opusfile.git > >I don't know anything about your environment, but you should be able to >compile your own library from the source files there.And for libopusfile, it needs to run with libopus and also libogg? And is this (http://downloads.xiph.org/releases/ogg/libogg-1.3.0.zip) the download link for libogg? BR H.K. Wong -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20130430/ca88f4d9/attachment.htm