mutagen
mutagen copied to clipboard
AAC detect
Why aac is detected only by extension and one of possible headers ADIF?
class AAC(FileType):
...
@staticmethod
def score(filename, fileobj, header):
filename = filename.lower()
s = endswith(filename, ".aac") or endswith(filename, ".adts") or \
endswith(filename, ".adif")
s += b"ADIF" in header
return s
Why can't rely on signature bytes
{"type": "audio", "extension": "aac", "mime": "audio/aac", "offset": 0, "signature": ["FF F1", "FF F9"]}
https://github.com/floyernick/fleep-py/blob/master/fleep/data.json#L38
We could, I'm not sure what all the possible values are, the spec suggests ffff8 as well and I have files which start with fff0. And of course most of the files start with an ID3 tag, so there is no way of knowing without the extension. But we could bump the score if we find the 12 bit sync at least.
I have been bitten by this problem with the file attached.
It's a big problem for me, I have thousands such files.
Mutagen just reports:
lockywolf@delllaptop:~$ mutagen-inspect test-mutagen-fails.aac
-- test-mutagen-fails.aac
can't sync to MPEG frame