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

Support ADTS (.aac) files #87

Open
DohrliOfDeath opened this issue Apr 24, 2020 · 3 comments
Open

Support ADTS (.aac) files #87

DohrliOfDeath opened this issue Apr 24, 2020 · 3 comments

Comments

@DohrliOfDeath
Copy link

Hello, I'm not sure how difficult it would be, but .aac support would be really nice.

It would make sense as .aac is often seen as the successor to .mp3, as it has better or same audio quality, but with a smaller file size.

Thanks in advance

@devsnd devsnd added the missing sample file Cannot reproduce since the reporter did not upload a sample audio file label May 2, 2020
@devsnd
Copy link
Owner

devsnd commented May 2, 2020

Hey @DohrliOfDeath

Most of the time aac is actually in a mp4 container, so you can just change this line here:
https://github.com/devsnd/tinytag/blob/master/tinytag/tinytag.py#L119

from

(b'.m4b', b'.m4a', b'.mp4'): MP4,

to

(b'.m4b', b'.m4a', b'.mp4', b'.aac'): MP4,

Which should do the trick for many files.

Please report back if that works for you, and if it does not, please provide a sample file that I can work with.

@DohrliOfDeath
Copy link
Author

Yes this worked for me, thank you. However, I don't think this would work for most people, as I tried to create a new .aac file with ffmpeg:

ffmpeg -i input.wav output.aac

and this did not work, I got a NoneType from tinytag.

On my part, this solution is fine, but if this problem comes up again, or someone wants to look into it, here is a sample file:
output.tar.gz

@devsnd
Copy link
Owner

devsnd commented May 16, 2020

Hey Dohrli,

thanks for the sample fiel.

The aac you created however is a "pure" audio file, in the sense that it's not inside an audio container format; Usually the container format, like MP4, contain all the data. What's more confusing is that AAC inside an MP4 container often have the .aac extension and having .mp4 as extension often means that it contains AAC, but often is also does not.

Anyway, that means that the only meta-data that could be read from your output.aac is duration and sample rate. This could only be done by parsing the actual audio data. I haven't looked into the AAC audio format to find out if that's easy to do though.

@devsnd devsnd added enhancement and removed missing sample file Cannot reproduce since the reporter did not upload a sample audio file labels May 16, 2020
@mathiascode mathiascode changed the title REQUEST: AAC Support Support ADTS (.aac) files Aug 14, 2023
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