sound-detector
v0.0.7
Published
Sound Detector
Downloads
3
Readme
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));
});