Get accurate duration for local or remote audio files, without needing to download or access the entire file.
Requires ffmpeg
to be installed, as endure uses the bundled ffprobe
tool.
const endure = require('endure');
endure.getDuration('<file/path/url>', (err, duration) => {
if (err) {
console.log(err.message);
};
console.log(duration);
});