Skip to content

Conversation

@royalmustard
Copy link

This PR add support for using a custom codec registry with the symphonia backend.

This allows easily add support for additional codecs, many of which are already supported by third party addons for symphonia (e.g. opus).

To use a custom registry, a (global) codec registry must be instantiated and all desired codecs must be registered in it.
Then, this registry can be given to a DecoderBuilder via the with_codec_registry function.
If no custom registry is given to the builder, the decoder will use symphonia's default registry, as before.

@dvdsk
Copy link
Member

dvdsk commented Oct 8, 2025

Wonderful idea :)

What do you think of adding these behind a cargo feature and doing the with_codec_registry bit ourselves (as in not exposing that to the user)?

@royalmustard
Copy link
Author

as in adding a third_party_codecs feature, which then uses a different registry? If you insist on it we could do it, however this would move the task of curating and selecting the third party crates to the rodio maintainers. Additionally, this would limit the users in case they want to use a codec which is not in the third party codecs "officially" supported by rodio at that time.

@roderickvd
Copy link
Member

I tend to agree that the power in this feature would be precisely to expose it to users.
To that extent it'd be worthwhile to have an example added that shows how to use it.

@roderickvd
Copy link
Member

I like it. Can you find a public-domain music.opus that you can include as asset?

Something as hybrid with what @dvdsk suggested, because Opus support is a requested feature, could we also offer a opus feature that sets this up with Symphonia automatically?

I expect Opus support to be come merged in to Symphonia eventually, but not soon.

@UnknownSuperficialNight
Copy link
Contributor

This is great, before as a get around for opus decoding I made a custom FFmpeg Source to use FFmpeg to decode opus

Although this is not as a great as a first party solution, It's still great compared to using FFmpeg would be cool to see in rodio.

I expect Opus support to be come merged in to Symphonia eventually, but not soon.

Yep, only the initial work has really started here pdeljanov/Symphonia#398

and Tracking of opus as a whole started here 5 years ago pdeljanov/Symphonia#8

@aschey
Copy link
Contributor

aschey commented Oct 28, 2025

Before merging this, you might want to update symphonia-adapter-libopus to 0.2 at least. I made an important change for gapless playback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants