-
Notifications
You must be signed in to change notification settings - Fork 159
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
Full RIFF/WAVE support with ID3 tags #408
Conversation
Very nice job @phw! I need to find some time to look at it in detail. |
cc9981e
to
3fbca92
Compare
See #409 for the corresponding AIFF changes. |
4a302a1
to
b6a94d2
Compare
I hacked some experimental INFO chunk reading / writing into my Picard branch for WAVE support and used this to test the tagging. I added / removed / updated the ID3 chunk, the INFO chunk and individual INFO chunk elements. Did this in combination with foobar2000 and also checked the results in other tools (Windows Explorer, Totem, VLC, WMP). The data could always be read, the files kept a valid structure. I think the current state of this branch is stable. |
3ac4721
to
2e6ad62
Compare
Rebased against current master and fixed merged conflict |
2e6ad62
to
234ac31
Compare
Fixed merge conflict |
Come on, hit that green button @lazka. |
Can this get merged? Would be great! :) |
234ac31
to
6504040
Compare
6504040
to
3dd764f
Compare
@lazka Now that a new release with fixes is out, could we finally get this merged? :) The failing tests seem to be unrelated to this PR and kind of random. |
3dd764f
to
b3f8459
Compare
Related to issue quodlibet#207
* fix wrong abstract attribute reference * fix reference to root ('RIFF') chuck
Should be Little-Endian, was Big-Endian.
This allows to safely perform multiple chunk insert / delete / resize operations on loaded RIFF files. See quodlibet#392
I updated the branch for the latest code changes. |
Very nice work @phw, thank you so much for completing this. |
This adds support for reading / parsing WAVE files and tagging them using ID3 tags.
This is #321 with history a little bit cleaned up and refactoring applied to address the issues discussed in #392. I opened a new PR as this is now easier to handle for me in my own fork.
The code was refactored so the RIFF code can now completely read the hierarchical RIFF chunk structure. There is explicit support for
LIST
chunks which can contain subchunks. Since the hierarchy is properly handled the code can now safely support multiple chunk insert / resize / delete operations while keeping the in-memory representation of all offsets and sizes intact. Also reading and writing the padding bytes is now all handled (previously this considered only a few special cases). You can now do things like this safely and it will all do the correct things:The relevant changes for this are in d326665 (padding bytes fixed) and bc8e150 (handling of the hierarchy and updating sizes / offsets after chunk changes).
Also handling of a
LIST INFO
chunk could now be easily implemented. The basic RIFF classes would support something like this to read the info:Or creating an info chunk:
The low level code is all there, so a higher level API for this could be added. But I intentionally left this out of this PR, I am not sure about a proper API for this yet. One option would be to handle this somewhat like ID3v1 is handled by having an option that automatically saves the INFO tag based on ID3 data.
@lazka @Borewit @maybeRainH I consider this now ready for review and testing, your help here is very welcomed.
Next up on my todo list is applying the refactoring here also to the AIFF code, which is plagued by the same issues of not fully handling padding bytes and damaging the files if multiple chunk changing operations are applied in one go.