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

mid3v2: Support AIFF files #346

Open
drone1 opened this issue Jun 7, 2018 · 8 comments
Open

mid3v2: Support AIFF files #346

drone1 opened this issue Jun 7, 2018 · 8 comments

Comments

@drone1
Copy link

drone1 commented Jun 7, 2018

Info: Python 2.7..10; Grabbed mutagen from this repo as of today via pip install "git+https://github.com/quodlibet/mutagen.git" --user

Problem: If I run a simple command with my mid3v2 like so:

~/Library/Python/2.7/bin/mid3v2 -v -a "TEST" test.aif

It seems to destroy the test.aif file, making it unplayable. It doesn't find the ID3 tag – it prints this error:

No ID3 header found; creating a new tag

The file is now destroyed and will not play.

Running ~/Library/Python/2.7/bin/mutagen-inspect test.aif yields:

can't sync to MPEG frame

I had to make a few changes to this script in order to get it to write frames to my test AIFF and MP3 files. I'm sorry I do not have time to thoroughly test or submit a PR but wanted to let you know.

I made sure to test with the existing version and with my changes, by editing: ~/Library/Python/2.7/lib/python/site-packages/mutagen/_tools/mid3v2.py

In write_files(), I had to do:

try: id3 = mutagen.File(filename).tags

...rather than of:

try: id3 = mutagen.id3.ID3(filename)

Then, later in write_files() calls id3.save(filename), which works fine. I mention this because I made the same change above (from write_files()) to delete_frames(), but also had to change the id3.save() line to id3.save(filename) – and now editing and deleting frames works well for me.

Let me know if I've done something dumb here, or I can provide any additional info for you.

Thanks for building this out! Very useful.

@lazka
Copy link
Member

lazka commented Jun 8, 2018

mid3v2 can only handle "normal" id3 files, not file formats like aiff which embed id3 tags in their own file structure.

if you do mid3v2 --delete-all test.aif the "destroyed" file should work again.

@drone1
Copy link
Author

drone1 commented Jun 8, 2018 via email

@lazka
Copy link
Member

lazka commented Jun 8, 2018

Is there a good reason not to do this?

I don't think so. Some options don't make sense like id3v1, but that's it I think.

@lazka lazka changed the title mid3v2 bugs? mid3v2: Support AIFF files Jun 8, 2018
@drone1
Copy link
Author

drone1 commented Jun 8, 2018 via email

@lazka
Copy link
Member

lazka commented Jun 8, 2018

how can I clone the repo and run THAT mutagen’s mid3v2 rather than the one installed

PYTHONPATH=. ./tools/mid3v2

@drone1
Copy link
Author

drone1 commented Jun 9, 2018

Hm, you sure?

> PYTHONHOME=. ./tools/mid3v2
ImportError: No module named site

@lazka
Copy link
Member

lazka commented Jun 9, 2018

PYTHONPATH != PYTHONHOME

@drone1
Copy link
Author

drone1 commented Jun 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants