Looking at this code:
source.buffer = audioBuffer;
audioBuffer.getChannelData(0).set(audio);
Can you try changing the order of these two lines? In other words, first set the channel data for audioBuffer and then assign it to source.buffer. Does that fix the problem for you?