-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support alternative containers #5
Comments
Claxon implements the FLAC spec which describes bit by bit what the stream should look like, and the spec makes no mention of embedding. So any container format that embeds FLAC would have to specify how it does so. If it embeds the streaminfo and frames without modification, then adding support for reading those would not be very hard. Actually, the Do you have any references for container formats that embed FLAC? I was able to find the ogg mapping and it looks like that one indeed embeds frames directly. |
The mp4 mapping should be described here: https://github.com/xiph/flac/blob/master/doc/isoflac.txt For the ogg mapping, my ogg crate should contain all relevant things: https://github.com/rustaudio/ogg If you need something, please write! I don't know about embeddings in other formats. The mp4 mapping spec only has a link to the ogg mapping, not to other mappings. |
I have added an example that shows how to read flac from an mp4 container using Reading from ogg will be a little bit more involved, because the header packet has a few fields before the streaminfo. It is only 12 bytes, mostly constants. Does Vorbis have some kind of identifying mark in the first packet too? Perhaps this is something that the |
Yes, vorbis has an identifying mark, but its being recognized in lewton, not by the ogg crate. Some containers transmit info about the kind of the stream within their own custom metatadata, other container formats like ogg don't do this. For ogg, everything is just opaque data.
Really cool! |
I added an ogg example too now! There are still a few rough edges in the Claxon API; I plan to implement a few more things to make reading from external container a bit nicer (the to dos in the examples). I’ll keep this issue open until then. |
Flac doesn't have to be inside its own custom container, it can also be encapsulated inside ogg or inside the mp4 container. It would be cool if this crate supported those use cases, maybe through optional cargo features.
My lewton crate is organized in a very generic fashion: its main function only takes a byte slice and treats that as one packet, regardless of the actual container format. The entire crate knows nothing about the container format, except for the
inside_ogg
module. Having such a setup for the claxon crate would be really cool.The text was updated successfully, but these errors were encountered: