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

Do not provide duration of audio #152

Open
vivekkumarcts opened this issue Oct 5, 2017 · 5 comments
Open

Do not provide duration of audio #152

vivekkumarcts opened this issue Oct 5, 2017 · 5 comments

Comments

@vivekkumarcts
Copy link

Using this plugin always provide duration as 0. Is there a way to get the duration?

@aozfen
Copy link

aozfen commented Dec 23, 2017

Give mp3 file as source to audio element. Get the audio object's duration information. I think I'll do it this way too :)

@Borewit
Copy link

Borewit commented Sep 13, 2018

Try music-metadata instead.

@ghost
Copy link

ghost commented Jan 28, 2019

pass object { duration: true } when calling function

mm(fs.createReadStream('sample.mp3'), { duration: true }, function (err, metadata) {

});

@Borewit
Copy link

Borewit commented Jan 28, 2019

Try music-metadata instead:

npm uninstall musicmetadata
npm install music-metadata
const mm = require('music-metadata');

mm.parseFile('sample.mp3', {duration: true})
  .then( metadata => {
    console.log(`duration = ${metadata.format.duration} milliseconds`)
  })

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

No branches or pull requests

4 participants
@vivekkumarcts @Borewit @aozfen and others