I\'m building a karaoke app using Phonegap for Ios.
I have audio files in the www/assets folder that I am able to play using the media.play()function
This al
The solution was to use the offlineAudioContext
The steps were: 1. Load the two files as buffers using the BufferLoader 2. Create an OfflineAudioContext 3. connect the two buffers to the OfflineAudioContext 4. start the two buffers 5. use the offline startRendering function 6. Set the offfline.oncomplete function to get a handle on the renderedBuffer.
Here's the code:
offline = new webkitOfflineAudioContext(2, voice.buffer.length, 44100);
vocalSource = offline.createBufferSource();
vocalSource.buffer = bufferList[0];
vocalSource.connect(offline.destination);
backing = offline.createBufferSource();
backing.buffer = bufferList[1];
backing.connect(offline.destination);
vocalSource.start(0);
backing.start(0);
offline.oncomplete = function(ev){
alert(bufferList);
playBackMix(ev);
console.log(ev.renderedBuffer);
sendWaveToPost(ev);
}
offline.startRendering();