Is there a way to add raw data from memory as a sample in Web Audio Api? I would like to add Int8Array (or Int16Array) as a buffer, there are only samples and WAV or MP3 format in the buffer. I tried audioContext.createBuffer and without it.
Something like that:
var buffer = audioContext.createBuffer(1,8192, 22000);
var intArray = new Int8Array(....);
buffer.buffer = intArray;
...
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
If this is not possible, is there a sound format compatible with contetx.decodeAudio () that is easy to "emulate" in memory? Those. just a headline or something like that.
Perty source
share