Skip to content

Instantly share code, notes, and snippets.

View AdrienFromToulouse's full-sized avatar

Adrien AdrienFromToulouse

  • EchoesHQ
  • Toulouse ⇄ Seoul ⇄ Singapore ⇄ Amsterdam
View GitHub Profile
@AdrienFromToulouse
AdrienFromToulouse / gist:5906a791a135dd00c8ce
Created October 31, 2015 12:31
Streaming - Web Audio API
var audioCtx = new AudioContext();
myScriptProcessor = audioCtx.createScriptProcessor(16384, 1, 1);
var rawAudioTemp = new Float32Array(data); // Your raw PCM incoming data
for (i = 0 ; i < rawAudioTemp.length ; i++) {
rawAudio.push(rawAudioTemp[i]);
}
streamingNode.onaudioprocess = function(event) {
for (chan= 0 ; chan< event.outputBuffer.numberOfChannels ; chan++) {