#parser #audio #opus #ogg

no-std oggopus-embedded

Parsing of oggopus files on embedded device flash

1 unstable release

new 0.1.0 May 9, 2025

#346 in Embedded development

BSD-3-Clause

71KB
1.5K SLoC

Ogg and opus header parsing

This can parse Ogg files as specified by RFC3533 and RFC7845 but only if they contain only Opus headers and data.

If you need a more complete Ogg parser, you should look elsewhere. There are lots of other implementations.

Limitations

This code was created for my personal hobby project where I needed to store some short Opus encoded audio on flash in an embedded system. It is not intended as a general purpose Ogg parser or Opus player and you should not use it with untrusted inputs. In particular streaming or seeking is not supported and Ogg file cannot contain streams other than Opus.

Please do not make demands that this should support this or that feature, thank you! If you need something and you can write code, you can also implement it yourself.

Family 255 and Reserved Channel Mapping support

Family 255 and Reserved channel mapping table parsing support can be enabled with family255 feature. It is usually not needeed for decoding mono or stereo audio and it makes OpusHeader struct to take more space so it's not enabled by default.

Missing features

The parser is missing a few features you might expect although it already has more than what I actually needed myself.

  • CRC checks.
  • Seeking.
  • Streaming data (e.g. from filesystem or network).
  • Parsing of Opus comments header.
  • Downmixing coefficients for Family 1 Channel Mapping down to stereo audio.

These could be implemented. Feel free to submit PRs if you happen to implement something.

License

This crate is BSD licensed. See COPYING for more infomation. Dependency crates have their own licenses.

Dependencies

~1MB
~19K SLoC