ddsol / mp3-duration Goto Github PK
View Code? Open in Web Editor NEWGet the duration of an MP3 file
License: MIT License
Get the duration of an MP3 file
License: MIT License
How to use this module in typescript ? I got the following error when I imported mp3-duration in this way:
import * as mp3 from 'mp3-duration'
Error: expecting a function but got [object Undefined]
How can I import the function directly ? Are there any methods to import from mp3-duration to get the duration of an mp3 file?
Hi, thanks for great plugin. is there any possible read duration via http ? not local files
thanks
I cant access the "duration" var from anywhere else. I tried appending it to an array, making it global but i just get "undefined"
One of my mp3 files has a broken header whose MPEG Audio version ID is 1, and mp3-duration
throws an exception:
TypeError: Cannot read property '14' of undefined
because there is no elements for VxL
n in the bitRates
object.
How about adding keys for VxL
n as for V1Lx
and V2Lx
?
(I've already done it on my forked version, and can make a PR if you think my fix is okay.)
Hi, thanks for the useful module!
I've found that the promise is returning the duration of the mp3 in seconds, not milliseconds. This is inconsistent with what the README states.
I am using version 1.1.0 from NPM.
Using suspend version 0.6.1 results in npm3 build fail.
Please update it to 0.7.0
Error: Cannot find module '../node_modules/promise/lib/es6-extensions'
at Function.Module._resolveFilename (module.js:327:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
I know this might sound dumb, but does this work with (or can it be modded to work with) mp4s, oggs, etc.?
Can this be updated to use native promises?
I was unable to get this working with any external assets. Please let me know if this is possible or what the issue might be. The error is :
"ENOENT: no such file or directory, open 'http://www.mfiles.co.uk/mp3-downloads/purcell-funeral-music-for-queen-mary.mp3'"
mp3Duration('http://www.mfiles.co.uk/mp3-downloads/purcell-funeral-music-for-queen-mary.mp3', function (err, duration) {
if (err) return console.log(err.message);
console.log('Your file is ' + duration + ' seconds long');
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.