Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Issue and Proposal) Rodio's features can be confusing #539

Open
dvdsk opened this issue Jan 18, 2024 · 0 comments
Open

(Issue and Proposal) Rodio's features can be confusing #539

dvdsk opened this issue Jan 18, 2024 · 0 comments
Labels
breaking Proposed change that would break the public API bug

Comments

@dvdsk
Copy link
Collaborator

dvdsk commented Jan 18, 2024

Background

Terminology

An audio file is a container (mp4/mkv etc). A container contains one or more streams and possibly metadata. Those streams are encoded with a codec. For audio those streams are usually multiple tracks. Rodio currently has no way to deal with multiple tracks in one file/container.

Some containers are special and can contain only a stream encoded with one specific codec. For example mp3 contains only MPEG-1 Audio Layer 3 encoded stream. Flac is another of these.

Features in rodio

Features in rodio can have two functions:

  • allow users to pick one decoder over another (for example minimp3 vs symphonia). Though this can only be done by disabling/enabling support by a decoder for a container.
  • speed up compilation by disabling unused codecs. Important for upstream libs building on rodio like bevy
  • exclude code with less permissive licenses (symphonia).

Right now there is no structure to the symphonia related features. There are features which

  • enable a single container
  • a single container and codecs often used with it.
  • a single codec.

Right now (cause of #516 and probably #527) we can not play ogg files. While there is a feature to enable the vorbis codec usually used in an ogg there is no feature to enable support for the ogg container. This will be addressed shortly.

Issue

This can be pretty confusing to users not familiar with the difference between codecs and decoders (such as me this morning). The errors you get if you fail to enable a codec feature can be puzzling. Without looking at the source code it is not possible to predict what a feature combination will do.

Proposal

  1. Document how enabled features determines the decoder used by rodio. Using different decoders for different streams in the same container will only be possible when specifying enabled codec and containers separately. As an example, it will be possible to configure rodio such that it uses lewton for ogg containing a vorbis stream while decoding ogg containing flac with symphonia.

  2. Make the current container features (for example symphonia-isomp4) enable all codecs. This removes the pitfall of Reverb example rans into error with symphonia vorbis decoder  #516.

  3. Add features that only enable a container without enabling any codecs to facilitate 1. and allow speeding up compilation.


Please let me know what you (the rodio user) think.

@dvdsk dvdsk changed the title Rodio's features can be confusing (Issue and Proposal) Rodio's features can be confusing Jan 18, 2024
@dvdsk dvdsk added the bug label Mar 25, 2024
@dvdsk dvdsk added the breaking Proposed change that would break the public API label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Proposed change that would break the public API bug
Projects
None yet
Development

No branches or pull requests

1 participant