squadio
TypeScript icon, indicating that this package has built-in type declarations

1.2.2 • Public • Published

Squadio

Calculate content metadata from audio, e.g. levels and duration.

Installation

Requires FFmpeg to be installed.

npm install --save withyoursquad/squadio

Usage

Squadio exports a single function calculateMetadata, which returns metadata about a given audio sample.

The metadata returned contains:

Name Description
duration Duration of the sample in seconds.
levels Normalized levels (0 is silence and 100 at the peak level of the sample)
peak The peak level of the sample as the reported Root Mean Square of the highest amplitude reported in a frame.
min The minimum level of the sample, in contrast to peak.

calculateMetadata accepts a single object as arguments, with the following available options:

Name Description
path File path to the audio sample being analyzed.
compressedLength (Optional) The number of samples to limit the output levels to. If undefined, defaults to the maximum value, 1000.

Attribution

  • Uses FFmpeg for most of the logic. We're shelling out to the release itself, so we are not required to provide its source or similarly license Squadio under the (L)GPL.
  • Test fixture sound effects from Pixabay.

Readme

Keywords

Package Sidebar

Install

npm i squadio

Weekly Downloads

3

Version

1.2.2

License

MPL-2.0

Unpacked Size

10.8 MB

Total Files

25

Last publish

Collaborators

  • schoonology
  • squad-dev-team