I'm looking to append data to an already existing AudioBuffer that is being played using web audio.
Upon receiving audio data to play, I create an AudioBuffer and then assign the data to the ArrayBuffer response.
var audioBuffer = context.createBuffer(1, audioToPlay.length, 16000);
audioBuffer.getChannelData(0).set(audioToPlay);
I then create a buffer source node and hook up the audio buffer to the web audio context.
var source = context.createBufferSource();
source.buffer = audioBuffer;
source.connect(context.destination);
source.start(0);
Now, what I would like to do is append more data (another ArrayBuffer) to the currently playing buffer, while avoiding having to use the onended
callback to create a new buffer..
Is there any way to do this? From what I can tell, this does not appear to be supported.