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

AIFF files cannot override ID3 #237

Open
lazka opened this issue Nov 4, 2015 · 8 comments
Open

AIFF files cannot override ID3 #237

lazka opened this issue Nov 4, 2015 · 8 comments

Comments

@lazka
Copy link
Member

lazka commented Nov 4, 2015

Originally reported by: Sophist UK (Bitbucket: Sophist-UK, GitHub: Sophist-UK)


mp3 objects can be initiated with an override to the ID3 object:

#!python
class mutagen.mp3.MP3(filename, ID3=None)

Similarly TrueAudio files:

#!python
class mutagen.trueaudio.TrueAudio(filename, ID3=None)

However AIFF files, do not have this option:

#!python
class mutagen.aiff.AIFF(filename)

All three are based on ID3File, so you would expect keyword arguments to work for all three, but adding ID3=something to AIFF results in an unknown keyword argument for a call to load.

Is this omission intentional, and if so why?


@lazka
Copy link
Member Author

lazka commented Nov 5, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


mutagen.aiff.AIFF is not an ID3File.

But there is no reason why it shouldn't be supported. (also like for RIFF, see #207, we could allow passing in a INFOChunk type instead of ID3)

@lazka
Copy link
Member Author

lazka commented Nov 5, 2015

Original comment by Sophist UK (Bitbucket: Sophist-UK, GitHub: Sophist-UK):


Thank you - I am making changes to the Musicbrainz Picard tagger and this is avoiding it working properly for AIFF files and ID3v23.

@lazka
Copy link
Member Author

lazka commented Nov 5, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


I see. Ideally picard should get rid of compatid3.py so this wouldn't be needed.

@lazka
Copy link
Member Author

lazka commented Nov 5, 2015

Original comment by Sophist UK (Bitbucket: Sophist-UK, GitHub: Sophist-UK):


That might be possible - we are discussing it.

@lazka
Copy link
Member Author

lazka commented Nov 8, 2015

Original comment by Sophist UK (Bitbucket: Sophist-UK, GitHub: Sophist-UK):


I have a working version (not yet submitted as a PR) which gets rid of compatid3.py. So as far as I am personally concerned this issue can be closed - though of course other folks may want to subclass ID3.

@lazka
Copy link
Member Author

lazka commented Nov 11, 2015

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


OK, thanks. I'll leave this open.

@phw
Copy link
Collaborator

phw commented Oct 22, 2018

FYI: The current solution in Picard is to pass the known_frames arguments to the mutagen.aiff.AIFF constructor. Same is true for mutagen.dsf.DSF. For our purpose this fixes the issue mostly. The only thing this does not catch is Picard's override of ID3.update_to_v23

@phw
Copy link
Collaborator

phw commented Jun 8, 2020

The override is not easy to add, all of the affected formats (currently AIFF, WAVE and DSF) both use a custom subclass of mutagen.id3.ID3. This subclass handles seeking the proper position inside the file and resizing the chunk in which the ID3 data is contained. This requires format specific code. I am not sure how feasible it is to implement such an override. It would maybe need some general refactoring to the ID3 classes to at least separate the positioning / resizing logic from the core functionality.

As far as Picard is concerned we handle all the needs without the use of the override, so this functionality is not required there.

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