polyfloyd / rust-id3

A rust library for reading and writing ID3 metadata
MIT License
245 stars 47 forks source link

Stream info #76

Closed sagudev closed 2 years ago

sagudev commented 2 years ago

Firstly I would like to thank you for this excellent crate and for reaching version 1.

I am working on a library that unifies metadata from different file formats into on struct. I'm using https://github.com/jameshurst/rust-metaflac for reading FLAC files and it has useful streaminfo data (sample rate, channels, lenght). Apparently mp3 has streaminfo in header: https://en.wikipedia.org/wiki/MP3#File_structure. Would it be feasible to provide it in this crate too or is it out of scope?

polyfloyd commented 2 years ago

ID3 is distinct from MP3, so yes this is out of scope. However, ID3 has frames that encode bits of information. Some of these frames tell something about the audio that it describes. Support for such ID3 frames is in scope.

I had a quick gander at the ID3 specification and there does not seem to be a frame type that holds the information you mentioned.

uklotzde commented 2 years ago

I have forked and substantially extended/rewritten mp3_duration (branch: streaminfo) for this purpose.

sagudev commented 2 years ago

I have forked and substantially extended/rewritten mp3_duration (branch: streaminfo) for this purpose.

There is meta reader/writer crate that also has streaminfo: Serial-ATA/lofty-rs.