Skip to content

Instantly share code, notes, and snippets.

@nickdiego
Created July 23, 2013 18:24
Show Gist options
  • Save nickdiego/6064829 to your computer and use it in GitHub Desktop.
Save nickdiego/6064829 to your computer and use it in GitHub Desktop.
<html>
<body>
<script>
document.write("Trying to get a Stream Audio...</br>");
navigator.webkitGetUserMedia({ "audio": true, "video": false }, gotStream, logError);
function gotStream (stream) {
document.write("Got a Stream Audio!</br>");
window.AudioContext = window.webkitAudioContext;
var audioContext = new AudioContext();
var mediaStreamSource = audioContext.createMediaStreamSource( stream );
mediaStreamSource.connect( audioContext.destination );
}
function logError (error) {
document.write("Got an Error!</br>");
document.write(error.name + ": " + error.message);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment