Playback of raw PCM audio programs in Web Audio
I have an array of sound samples (16 bit):
[0, 120, 320, 120, 0, -100, -30000, 65, 2, 3, 10, ...]
They range from -32768 to 32767. I would like to be able to play samples using the web audio API.
I know he expects the original buffer to be ArrayBuffer
, but I can't figure out how to convert a bunch of samples ArrayBuffer
to playable using the web audio API.
Any advice?
+3
source to share