wave-recorder
Pipe Web Audio API nodes into PCM Wave files.
Install
$ npm install wave-recorder
API
var WaveRecorder =
var recorder = WaveRecorder(options)
Returns a stream. Pipe the stream to a file (you can use web-fs or something similar).
options:
channels
: (defaults to2
)bitDepth
: can be16
or32
(defaults to32
)silenceDuration
: (optional) Specify the maximum duration (in seconds) of silence to record before pausing. Disabled if0
.
recorder.input
(AudioNode)
Connect the audio you want to record to this node.
recorder.on('header', func)
Called on every write with a new header containing an updated file length. You can write this to the start of the file, or ignore (most decoders can handle it, just the duration may appear incorrect).
Example
var WaveRecorder = var WebFS = navigatorwebkitPersistentStorage { var fs = var audioContext = navigator}