Skip to content

Instantly share code, notes, and snippets.

View jamesdanged's full-sized avatar

James Dang jamesdanged

  • San Francisco, CA
View GitHub Profile
@aike
aike / getUserMediaAudioMock.js
Created September 1, 2014 03:22
getUserMedia API mock for audio
// This program is licensed under the MIT License.
navigator.webkitGetUserMedia = function(opt, ok, ng) {
ok(null);
};
AudioContext.prototype.createMediaStreamSource = function() {
var osc = this.createOscillator();
osc.type = 'sine';
var gain = this.createGain();
gain.gain.value = 0.0;
osc.connect(gain);