npm.io
0.0.7 • Published 8 years agoCLI

sound-detector

Licence
MPL 2.0
Version
0.0.7
Deps
2
Size
714 kB
Vulns
0
Weekly
0

Sound Detector

Installation

npm install -g sound-detector

Usage

Command line
# read from a file
sounddetector -p {example.mp3}

# read from input stream
sounddetector -s < cat {example.mp3}

# skip the ffmpeg convert
sounddetector -p {example.mp3} --no-ffmpeg
Node.js
const path = require('path');
const soundDetector = require('sound-detector');

const filepath = './example.mp3'; // path to your video/audio
const soundType = 'gunfire';
soundDetector({
  type: soundType,
  path: path.resolve(filepath)
}).then(timestamps => {
  process.stdout.write(JSON.stringify(timestamps));
});