I didn't really dig through your code, but it looks ok from a pure WebAudio API perspective. However, if your audio is all 0s after conversion to 16bits, the problem is just the conversion itself. Float32 samples are values between 0 and 1, so when you convert the array, values end up all rounded to 0 (plus perhaps the occasional 1). You need to scale the samples before converting. Int16 audio samples should be between -32768 and 32767, so simply multiply every sample by 32768 and then convert to Int16.