get-audio-duration
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

get-audio-duration

NPM version Build Status Maintainability Test Coverage License NPM bundle size (minified) Downloads

Get the duration of audio files with ffprobe.

Supported platforms

Currently this package only supports Linux, Windows 7+, and MacOS 10.9+. This package does not work in the browser, iOS or Android.

Install

$ npm install --save get-audio-duration

Usage

const { getAudioDurationInSeconds } = require('get-audio-duration')

getAudioDurationInSeconds('audio.flac').then((duration) => {
  console.log(duration)
})

// If you need to customize the path to ffprobe...

getAudioDurationInSeconds('audio.flac', '/path/to/ffprobe').then((duration) => {
  console.log(duration)
})

Package Sidebar

Install

npm i get-audio-duration

Weekly Downloads

9,070

Version

4.0.1

License

MIT

Unpacked Size

19 kB

Total Files

14

Last publish

Collaborators

  • lluis