saecki / mp4ameta

A library for reading and writing iTunes style MPEG-4 audio metadata
Apache License 2.0
35 stars 5 forks source link

Access read-only audio properties #13

Closed uklotzde closed 3 years ago

uklotzde commented 3 years ago

For accessing the following read-only properties I need to read the file twice using the mp4 crate:

Would it be possible to provide them for consistency and completeness?

saecki commented 3 years ago

That should be possible.

saecki commented 3 years ago

So i finally got around implementing this. If this fits your needs I would publish a new release.

uklotzde commented 3 years ago

Great to hear, thank you! Will try this soon and report back.

uklotzde commented 3 years ago

I suggest to return std::time::Duration instead of f64 seconds.

uklotzde commented 3 years ago

Removed mp4 in favor of mp4ameta: https://gitlab.com/uklotzde/aoide-rs/-/commit/3f326ae9a2fad0cabf2c987c9f94a21e4da1597a

Another idea I just discovered in an embedded crate: How about using Hz44100 instead of F44100 for the sample rate frequencies? This would be explicit, readable, and concise.

saecki commented 3 years ago

Using explicit std::time::Duration and Hz definitely sounds good. I just fixed a bug with parsing descriptors and now all songs in my library are successfully parsed, however I still need to clean things up. After that and your suggested changes we should be good to go.

saecki commented 3 years ago

I just published version 0.9.0. Seeing the usage in aoide-rs I added a hz() method to the SampleRate enum.