Last active
January 11, 2018 15:44
-
-
Save cozzbie/b7287fbae49dcba27c25cb11ddcb47cd to your computer and use it in GitHub Desktop.
A WebRTC audio channel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function streamSuccess(stream) { | |
window.AudioContext = window.AudioContext || window.webkitAudioContext; | |
var audioContext = new AudioContext(); | |
// Create an AudioNode from the stream | |
var mediaStreamSource = audioContext.createMediaStreamSource(stream); | |
// Hear thyself! | |
mediaStreamSource.connect(audioContext.destination); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment