react-orchestra
Version:
A toolbox to build interactive and smart instruments on the web and mobile.
13 lines (12 loc) • 465 B
JavaScript
var getAudioContext = function getAudioContext() {
var AudioContext = window.AudioContext // Default
|| window.webkitAudioContext // Safari and old versions of Chrome
|| false;
if (!AudioContext) {
alert('Sorry but the WebAudio API is not supported on this browser. Please consider using Chrome or Safari for the best experience ');
return null;
}
return new AudioContext();
};
var audioContext = getAudioContext();
export default audioContext;