Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.
if (audioContext.state == 'suspended') {
console.log('audioContext.resume');
audioContext.resume();
}
This works fine. However, there are cases where it is desired to use an OfflineAudioContext, such as Rendering/Exporting to a WAV file. I managed it to work fine. However, the following error is thrown:
Uncaught (in promise) DOMException: cannot resume an offline context that has not started
This is expected, as we should not use resume() in an OfflineAudioContext. A simple solution would be:
Hi! The first line of code of queueWaveTable() is
if (audioContext.state == 'suspended') { console.log('audioContext.resume'); audioContext.resume(); }
This works fine. However, there are cases where it is desired to use an OfflineAudioContext, such as Rendering/Exporting to a WAV file. I managed it to work fine. However, the following error is thrown:
Uncaught (in promise) DOMException: cannot resume an offline context that has not started
This is expected, as we should not use resume() in an OfflineAudioContext. A simple solution would be:
if (audioContext.state == 'suspended' && audioContext.constructor.name == "AudioContext") { console.log('audioContext.resume'); audioContext.resume(); }
What do you think?
Thanks! Danny Bullo