demo/events-demo.js
function () {
    try {
        window.AudioContext = window.AudioContext || window.webkitAudioContext;
        audioContext = new window.AudioContext();
        consoleMessage("Web Audio Context is ready");
    }
    catch (e) {
        consoleMessage('Web Audio API is not supported in this browser: ' + e);
        return false;
    }

    // Create a gain node for volume control
    micGainNode = audioContext.createGain();

    // Connect the gain node to the speaker
    micGainNode.connect(audioContext.destination);

    return true;
}
function () {
    try {
        window.AudioContext = window.AudioContext || window.webkitAudioContext;
        audioContext = new window.AudioContext();
        consoleMessage("Web Audio Context is ready");
    }
    catch (e) {
        consoleMessage('Web Audio API is not supported in this browser: ' + e);
        return false;
    }

    // Create a gain node for volume control
    micGainNode = audioContext.createGain();

    // Connect the gain node to the speaker
    micGainNode.connect(audioContext.destination);

    return true;
}
function ( ) { try { window . AudioContext = window . AudioContext || window . webkitAudioContext ; audioContext = new window . AudioContext ( ) ; consoleMessage ( "Web Audio Context is ready" ) ; } catch ( e ) { consoleMessage ( 'Web Audio API is not supported in this browser: ' + e ) ; return false ; } // Create a gain node for volume control micGainNode = audioContext . createGain ( ) ; // Connect the gain node to the speaker micGainNode . connect ( audioContext . destination ) ; return true ; }
Creates the Web Audio Context and audio nodes for output.
Creates the Web Audio Context and audio nodes for output .