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
Support Apple AIFF-C pseudo compression in aifc.py #74263
Comments
aifc.py fails to open AIFF files containing the compression type "sowt" in the COMM chunk with an "unsupported compression type" error. This compression type is an Apple specific extension that signals that the data is not actually compressed but is stored uncompressed in little Endian order. Supporting it would require a trivial change to allow the compression type as a byte-string and to add a do-nothing _convert routine. This would allow aifc.py to be used with AIFF files on Apple macOS. |
Anyway, such a function addition could only get into 3.7. |
Seems the "sowt" compression is not just a no-op operation. Perhaps it should change a byte order. Needed tests and test files for the new compression. |
I think it's probably better as a no-op. Currently in my patch I just put return data You could do
to reverse the sample, so that it came out as big endian, but if you leave it as a no-op then the data is returned in the native format for Intel Mac OS, which is the whole point of the "sowt" encoding. Either way, the user can easily reverse the data in a The patch as I've proposed it works fine on my MacOS boxes, but I have only tested it with AIFF-C files from one source. |
If you read a normal uncompressed AIFF with aifc, the samples are in big-endian order and need to be converted before they can be played on little-endian systems. As all other compression schemes produce big-endian data, so should 'SOWT' encoded AIFF. Therefore, the bytes of each sample should be swapped on read and write. See also: https://en.wikipedia.org/wiki/Audio_Interchange_File_Format#AIFF_on_Mac_OS_X |
Thanks for reporting and the initial patch, Toby. And thanks for pushing this across the finish line, Yussuf! ✨ 🍰 ✨ |
Hey! thanks for letting me know, glad it got there in the end. T. On Fri, 13 Aug 2021, at 12:33, Łukasz Langa wrote:
|
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: