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

Use music-metadata to extract the duration #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use music-metadata to extract the duration #14

wants to merge 1 commit into from

Conversation

Borewit
Copy link

@Borewit Borewit commented Jan 14, 2020

Use music-metadata to determine the duration.
Works also with other audio formats.

const mm = require('music-metadata');
const metadata = await mm.parseFile(path);
// metadata.format.duration will have the duration in seconds

Good luck with your project.

@zacariec
Copy link
Owner

Hey @Borewit looks good. I have some things I need to push to master this week before I merge.
This is your own module correct?
Does it support .mp4? At the moment the .mp4 I'm getting is downloading without Meta, this might be a great work around if I can workout how to inject metadata into the file.

Thanks.

@Borewit
Copy link
Author

Borewit commented Jan 20, 2020

MPEG-4 is supported, .m4a better than .mp4 as module is primary intended for extracting metadata audio files.
In the very latest version, I added metadata.trackInfo. This may be better suitable for video files. Note that this is experimental, and not matured yet. Which means there is room for improvement.

Give it try, and feel free to create an issue if something is missing.

Writing metadata is not something I will have implemented in the short term. I do have an hack though to manipulate MPEG-4.

@Borewit
Copy link
Author

Borewit commented Feb 18, 2020

Any update on this PR @GPudgima?

@Borewit
Copy link
Author

Borewit commented Dec 20, 2020

Happy Christmas, can you merge this one @raylway?

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