thebigmunch / audio-metadata

A library for reading and, in the future, writing audio metadata. https://audio-metadata.readthedocs.io/
https://forum.thebigmunch.me
MIT License
53 stars 11 forks source link

Support for M4A Based containers #4

Closed Ristellise closed 5 years ago

Ristellise commented 5 years ago

Hey there. I was really intrested in your package when I was looking for an alternative to mutagen and other alike audio metadata parsers. I really liked your because I can read directly from memory (BytesIO).

However I noticed it lacked support for m4a containers [mainly AAC and Apple lossless]. So I was wondering if you could implement it. Thanks again.

thebigmunch commented 5 years ago

Eventually it will as shown in the TODO as I get to it. I actually have a partial MP4 implementation locally. The MP4 format is definitely a pain to implement compared the formats already implemented. It's also the one I was (and still am) least familiar with; I already knew FLAC, MP3, ID3, WAV specs rather well before I started. Things got delayed further because I really couldn't sit down to program long enough for a couple months due to a severe trapezius strain.

Hopefully I'll get back to making some progress on it soon. Of course, if anyone sees this and wants to help speed things along, let me know.

PS Thanks for the kind words. I think reading from memory is definitely something that just makes sense. I'm a bit baffled that it's not really part of other such libraries.

thebigmunch commented 5 years ago

Just an FYI... about a week after you opened this issue, I actually had a strong enough urge to break past the huge slog and finally finish at good portion of MP4 support.

>>> audio_metadata.load('test.m4a')
<MP4 ({
    'filepath': 'C:\\Projects\\thebigmunch\\audio-metadata-test\\test.m4a',
    'filesize': '9.21 MiB',
    'pictures': [],
    'streaminfo': <MP4StreamInfo ({
        'bit_depth': 16,
        'bitrate': '361 Kbps',
        'channels': 2,
        'codec': 'mp4a',
        'codec_description': 'AAC LC',
        'duration': '03:33',
        'sample_rate': '44.1 KHz',
    })>,
    'tags': <MP4Tags ({
        'album': ['Sidewalks'],
        'artist': ['Matt & Kim'],
        'date': ['2010'],
        'encodedby': [
            'qaac 2.17, CoreAudioToolbox 7.10.7.0, AAC-LC Encoder, TVBR q127, Quality 96',
        ],
        'genre_id3': ['\x00\x12'],
        'title': ['Cameras'],
        'tracknumber': ['3/10'],
    })>,
})>

>>> audio_metadata.load('test-lossless.m4a')
<MP4 ({
    'filepath': 'C:\\Projects\\thebigmunch\\audio-metadata-test\\test-lossless.m4a',
    'filesize': '27.11 MiB',
    'pictures': [],
    'streaminfo': <MP4StreamInfo ({
        'bit_depth': 16,
        'bitrate': '1069 Kbps',
        'channels': 2,
        'codec': 'alac',
        'codec_description': 'ALAC',
        'duration': '03:33',
        'sample_rate': '44.1 KHz',
    })>,
    'tags': <MP4Tags ({
        'album': ['Sidewalks'],
        'artist': ['Matt & Kim'],
        'date': ['2010'],
        'encodedby': [
            'qaac 2.17, CoreAudioToolbox 7.10.7.0, Apple Lossless Encoder',
        ],
        'genre_id3': ['\x00\x12'],
        'title': ['Cameras'],
        'tracknumber': ['3/10'],
    })>,
})>

Still got a bit to go before I'd release it. And it definitely won't cover 100% of MP4 files on first release. But it should handle most MP4 files just fine. So progress is actually happening : P

Ristellise commented 5 years ago

Nice! I don't mind helping you out with the more obscure audio formats.

thebigmunch commented 4 years ago

See #14.