TianyiShi2001 / audiotags

Unified IO for different types of audio metadata
https://tianyishi2001.github.io/audiotags
MIT License
41 stars 29 forks source link

`wav`/`aiff` file support #22

Open lukethacoder opened 1 year ago

lukethacoder commented 1 year ago

Is there a reason wav/aiff files are not supported? Had a poke around in the id3 package and it looks like they are supported over there?

Serial-ATA commented 1 year ago

This crate is passively maintained. If you'd like to submit a PR to add that support it'll likely be added :slightly_smiling_face:.

lukethacoder commented 1 year ago

Had a deeper look into how id3 manages wav/aiff files. It has special methods specifically for reading those file types (read_from_wav_path/read_from_aiff_path).

Looking at how this package has been built it doesn't look like an easy task to implement support for wav/aiff file types. The dynamic inner class assumes the package (id3 in this case) uses the read_from_path method for reading files.

https://github.com/TianyiShi2001/audiotags/blob/2fa3f6c0d2d45d471a90b4c68ffa5c5cc8fd36a8/audiotags-dev-macro/src/lib.rs#L27-L32

I assume adding support for wav/aiff file types would involve a refactor of the audiotags-dev-macro to allow custom path reader methods.

Serial-ATA commented 1 year ago

Yeah, it's definitely not the easiest problem to solve. Could always just do this:

impl Id3v2Tag {
   pub fn read_from_wav_path(path: impl AsRef<Path>) -> Self {
       // ...
   }
}

// Then

use audiotags::components::Id3v2Tag;

fn main() {
    let tag = Id3v2Tag::read_from_wav_path("foo.wav");
}

Since this behavior is exclusive to ID3v2.

andreykaere commented 11 months ago

Hey! I've just implemented this "crutch": https://github.com/andreykaere/audiotags. Feel free to use it if you need it

jct-tympanon commented 4 months ago

hey there, i was recently comparing id3 and audiotags for a little project i'm working on, and found this issue. id3 improved the behavior on their end a few months ago, so the only thing you really need now is a version bump (see the PR).