rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Symphonia custom registry support

Open royalmustard opened this issue 2 months ago • 7 comments

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.

royalmustard avatar Oct 08 '25 19:10 royalmustard

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)?

yara-blue avatar Oct 08 '25 20:10 yara-blue

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.

royalmustard avatar Oct 08 '25 21:10 royalmustard

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 avatar Oct 10 '25 20:10 roderickvd

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.

roderickvd avatar Oct 12 '25 08:10 roderickvd

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 https://github.com/pdeljanov/Symphonia/pull/398

and Tracking of opus as a whole started here 5 years ago https://github.com/pdeljanov/Symphonia/issues/8

UnknownSuperficialNight avatar Oct 13 '25 00:10 UnknownSuperficialNight

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

aschey avatar Oct 28 '25 06:10 aschey

@royalmustard would you take a stab at getting the CI to pass?

roderickvd avatar Dec 10 '25 15:12 roderickvd