Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

get-audio-duration

2.0.3 • Public • Published

get-audio-duration

NPM version Build status Test coverage Dependency Status License NPM bundle size (minified) Downloads

Get the duration of audio files/streams with ffprobe.

Install

$ npm install --save get-audio-duration

Usage

const { getAudioDurationInSeconds } = require('get-audio-duration');
 
// From a local path...
getAudioDurationInSeconds('audio.flac').then((duration) => {
  console.log(duration);
});
 
// From a readable stream...
 
const fs = require('fs');
const stream = fs.createReadStream('audio.flac');
 
getAudioDurationInSeconds(stream).then((duration) => {
  console.log(duration);
});

Install

npm i get-audio-duration

DownloadsWeekly Downloads

869

Version

2.0.3

License

MIT

Unpacked Size

15.3 kB

Total Files

14

Last publish

Collaborators

  • avatar