Yet another MediaRecorder shim. Only supports audio/wav
for the moment, but makes some effort to be extensible.
Browser implementations for this API are inconsistent / incomplete.
- scriptProcessorNode
- Totally non-standard "configure()" method
var MediaRecorder = require('media-recorder')
var context = require('audio-context')
var r = new MediaRecorder(stream, 'audio/wav')
r.configure({
audio: {
capture: {
context: context,
size: chunkSize,
mono: true
},
encode: {
bitDepth: 16,
sampleRate: context.sampleRate >> 1
}
},
video: {
// not yet
}
})
r.ondataavailable = function (evt) {
doSomethingCool(evt.data)
}
r.start(100) // get data roughly every 100ms
npm test
No proper tests yet. For now the command above just runs standard.
Hacked from:
MIT