squadio
v1.2.2
Published
Calculate content metadata from audio, e.g. levels and duration.
Downloads
4
Readme
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. |