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

Getting metadata from an mp3 stream with ReadOnlySource #349

Open
GeoffClements opened this issue Jan 22, 2025 · 2 comments
Open

Getting metadata from an mp3 stream with ReadOnlySource #349

GeoffClements opened this issue Jan 22, 2025 · 2 comments

Comments

@GeoffClements
Copy link

GeoffClements commented Jan 22, 2025

This is an issue for me but is really just a question as it may not be a bug.

I'm streaming an audio file and using ReadOnlySource. At the beginning of the stream I want to announce the artist etc, so I'm interesting in the metadata from ProbeResult.

When I stream flacs or ogg/vorbis this works fine but on mp3 files I don't get any metadata, neither from ProbeResult.format.metadata() nor from ProbeResult.metadata.get().

The interesting thing is that when I use the example symphonia-play on the exact same file, now not streamed but read from the disk, the metadata is extracted and displayed correctly. The only difference that I can see is that we have a MediaSourceStream rather than a ReadOnlySource, at least, that's my guess.

Am I asking the impossible of Symphonia here?

@pdeljanov
Copy link
Owner

pdeljanov commented Jan 25, 2025

I'll need more information to give you a definitive answer since there are some valid reasons why you may be seeing this behaviour, but it's hard to say for sure. Could you run symphonia-play with the environment variable RUST_LOG=trace and collect the logs?

MP3s typically store metadata in ID3v1 and ID3v2 tags. The former are located at the end of the file and thus can't be read if the source is unseekable, while the latter is at the front of the file. You sometimes also see APE tags which can be in both locations.

@GeoffClements
Copy link
Author

GeoffClements commented Jan 26, 2025

This appeared in the log, in fact it's the only entry but I didn't play the whole file through. Looks like it might be relevant.
INFO symphonia_metadata::id3v2 > unsupported frame UFID

I suspect storing the id3v1 tags at the end of the file means that I am asking for the impossible with a read-only source. Thanks for confirming this.

I do have id3v2 tags as well as id3v1, but it looks like there is a problem with them from the log.

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

No branches or pull requests

2 participants