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

Add support for MPEG-4 Audiobook (.m4b) #177

Closed
wants to merge 8 commits into from
Closed

Add support for MPEG-4 Audiobook (.m4b) #177

wants to merge 8 commits into from

Conversation

Borewit
Copy link
Collaborator

@Borewit Borewit commented Nov 28, 2018

Fixes #165
Related: #99, #60, #38

Note that I removed check([0x4D, 0x34, 0x41, 0x20]), at offset 0. I don't think this picking out any MPEG-4 audio file.

test.js Outdated Show resolved Hide resolved
test.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

Tests are failing as the audiobook fixture is being detected as .mp4.

@Borewit
Copy link
Collaborator Author

Borewit commented Nov 30, 2018

Not sure if it is actually that simple to pick out the .m4b extension.

@sindresorhus
Copy link
Owner

@Borewit Still interested in finishing this? :)

@Borewit
Copy link
Collaborator Author

Borewit commented Jan 22, 2019

You may close the issue.
I don't think there is a feasible way to extract the audio-book type.
Although this can be found in the metadata, the complexity to get that out with the risk it might not be within the first 4k, I don't think it's worth to implement it.

I started this PR based on the assumption it could be extracted with the first bytes, which appears not to be the case.

I went through the changes of this PR, and kept a minor code correction, which I moved to PR.

I use this module for music-metadata to determine the audio file type, based on the content, as a fallback in case the audio type wasn't provided by the user. As long as I get one of the MPEG-4 MIME-types it works for me.

Feel free to ping me on any discussion regarding audio file type, or on requests to cover new audio file types.

@sindresorhus
Copy link
Owner

I understand. No worries at all :)

Feel free to ping me on any discussion regarding audio file type, or on requests to cover new audio file types.

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants