mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

Does mutagen support a file-type agnostic abstraction layer?

Open jtpavlock opened this issue 5 years ago • 5 comments

Does mutagen provide a way to abstract the differences between audio formats?

For example, I'd like to say something like:

audio_file = mutagen.File('music.mp3')
audio_file2 = mutagen.File('music.flac')

print(audio_file.artist)
print(audio_file2.artist)

Based on the docs, it seems like mutagen can return the type of file if unknown ahead of time, but then you still have to import FLAC/ID3 based on what type of file you find? Do I understand that correctly?

jtpavlock avatar Aug 19 '20 22:08 jtpavlock

No, there is https://github.com/beetbox/mediafile as a wrapper though

lazka avatar Aug 20 '20 06:08 lazka

No, there is https://github.com/beetbox/mediafile as a wrapper though

Is this something you'd be interested in implementing/merging into mutagen?

jtpavlock avatar Aug 20 '20 06:08 jtpavlock

I'm not very motivated implementing/maintaining it myself, so I'd prefer something separate like mediafile. I'd be happy to add API that would help such a wrapper though.

lazka avatar Aug 21 '20 14:08 lazka

Does quodlibet implement a similar wrapper internally (also picard) or are there maybe other/better ways of doing this?

jtpavlock avatar Aug 21 '20 15:08 jtpavlock

  • quodlibet: https://github.com/quodlibet/quodlibet/tree/master/quodlibet/formats
  • picard: https://github.com/metabrainz/picard/tree/master/picard/formats

lazka avatar Aug 21 '20 15:08 lazka

There is also #186 for this. Closing this issue to reduce duplicates.

phw avatar Feb 15 '23 07:02 phw