Skip to content

Add Ogg Vorbis decoding support via microVorbis#15

Merged
kahrendt merged 2 commits into
mainfrom
ogg-vorbis-support
Jun 18, 2026
Merged

Add Ogg Vorbis decoding support via microVorbis#15
kahrendt merged 2 commits into
mainfrom
ogg-vorbis-support

Conversation

@kahrendt

Copy link
Copy Markdown
Contributor

Decode Ogg Vorbis alongside the existing FLAC/MP3/Opus/WAV codecs, following the same patterns.

  • Add AudioFileType::VORBIS, AudioDecoder::decode_vorbis(), and build wiring (CMake option, FetchContent of micro-vorbis v0.1.0, Kconfig, idf_component.yml dependency).
  • Detect plain Ogg (audio/ogg, application/ogg, .ogg) as Vorbis; Opus needs an explicit signal (audio/opus, codecs=opus, .opus). The classification is the same in every build: a type whose codec is compiled out yields NONE rather than the other Ogg codec.
  • Extend the decode_benchmark example with a Vorbis clip.
  • Update README, INTEGRATION, and CLAUDE docs.

Decode Ogg Vorbis alongside the existing FLAC/MP3/Opus/WAV codecs,
following the same patterns.

- Add AudioFileType::VORBIS, AudioDecoder::decode_vorbis(), and build
  wiring (CMake option, FetchContent of micro-vorbis v0.1.0, Kconfig,
  idf_component.yml dependency).
- Detect plain Ogg (audio/ogg, application/ogg, .ogg) as Vorbis; Opus
  needs an explicit signal (audio/opus, codecs=opus, .opus). The
  classification is the same in every build: a type whose codec is
  compiled out yields NONE rather than the other Ogg codec.
- Extend the decode_benchmark example with a Vorbis clip.
- Update README, INTEGRATION, and CLAUDE docs.
@kahrendt kahrendt requested a review from Copilot June 18, 2026 11:55
@kahrendt kahrendt added the new-feature PR adds a new feature; bumps minor version label Jun 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Ogg Vorbis decoding to micro-decoder (alongside the existing FLAC/MP3/Opus/WAV support) using the micro-vorbis library, and updates build/config wiring plus documentation/examples to match the new codec matrix and Ogg detection rules.

Changes:

  • Introduces AudioFileType::VORBIS and a Vorbis decode path in AudioDecoder backed by micro_vorbis::OggVorbisDecoder.
  • Updates format detection logic so “plain Ogg” resolves to Vorbis and Opus requires an explicit signal (content-type or .opus extension), with “compiled-out codec => NONE” behavior.
  • Adds build system toggles/dependencies (CMake, Kconfig, ESP-IDF component manifest) and extends the decode benchmark + docs/README accordingly.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types.cpp Updates Content-Type / extension detection to distinguish Opus vs Vorbis within Ogg.
src/audio_decoder.h Adds micro-vorbis include, decoder method declaration, and Vorbis decoder member.
src/audio_decoder.cpp Wires Vorbis into start()/decode switch and implements decode_vorbis().
include/micro_decoder/types.h Adds AudioFileType::VORBIS and adjusts enum numeric assignments.
cmake/host.cmake Adds host CMake option + FetchContent wiring for micro-vorbis.
cmake/esp-idf.cmake Maps CONFIG_MICRO_DECODER_CODEC_VORBIS to MICRO_DECODER_CODEC_VORBIS.
Kconfig Adds MICRO_DECODER_CODEC_VORBIS toggle.
idf_component.yml Adds micro-vorbis managed dependency and updates description.
examples/decode_benchmark/src/main.cpp Adds a Vorbis clip to the benchmark run list.
examples/decode_benchmark/sdkconfig.defaults Enables Vorbis in the benchmark default config.
examples/decode_benchmark/README.md Updates benchmark docs/results to include Vorbis.
examples/decode_benchmark/convert_audio.py Adds Vorbis encode step when generating embedded test audio.
README.md Updates top-level feature/docs text to include Vorbis.
docs/INTEGRATION.md Documents Ogg ambiguity rules and adds a recognized types table including Vorbis.
CLAUDE.md Updates internal “codec listing order” convention to include Vorbis.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/micro_decoder/types.h
Comment thread src/types.cpp Outdated
Comment thread idf_component.yml
A bare substring search would read codecs=notopus or opusenc as Opus.
Match opus as a whole token instead, bounded by non-alphanumeric chars.
@kahrendt kahrendt enabled auto-merge (squash) June 18, 2026 12:09
@kahrendt kahrendt merged commit 7365792 into main Jun 18, 2026
7 checks passed
@kahrendt kahrendt deleted the ogg-vorbis-support branch June 18, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature PR adds a new feature; bumps minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants