Skip to content

kicco/media-recorder

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

media-recorder

Yet another MediaRecorder shim. Only supports audio/wav for the moment, but makes some effort to be extensible.

Why

Browser implementations for this API are inconsistent / incomplete.

How

Example

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

Test

npm test

No proper tests yet. For now the command above just runs standard.

Credits

Hacked from:

License

MIT

About

A MediaRecorder shim

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 93.6%
  • HTML 6.4%