demo/file-demo.js
function () {

    if (window.cordova && window.cordova.file && window.audioinput) {

        initUIEvents();

        consoleMessage("Use 'Start Capture' to begin...");

        // Subscribe to audioinput events
        //
        window.addEventListener('audioinput', onAudioInputCapture, false);
        window.addEventListener('audioinputerror', onAudioInputError, false);
    }
    else {
        consoleMessage("Missing: cordova-plugin-file or cordova-plugin-audioinput!");
        disableAllButtons();
    }
}
function () {

    if (window.cordova && window.cordova.file && window.audioinput) {

        initUIEvents();

        consoleMessage("Use 'Start Capture' to begin...");

        // Subscribe to audioinput events
        //
        window.addEventListener('audioinput', onAudioInputCapture, false);
        window.addEventListener('audioinputerror', onAudioInputError, false);
    }
    else {
        consoleMessage("Missing: cordova-plugin-file or cordova-plugin-audioinput!");
        disableAllButtons();
    }
}
function ( ) { if ( window . cordova && window . cordova . file && window . audioinput ) { initUIEvents ( ) ; consoleMessage ( "Use 'Start Capture' to begin..." ) ; // Subscribe to audioinput events // window . addEventListener ( 'audioinput' , onAudioInputCapture , false ) ; window . addEventListener ( 'audioinputerror' , onAudioInputError , false ) ; } else { consoleMessage ( "Missing: cordova-plugin-file or cordova-plugin-audioinput!" ) ; disableAllButtons ( ) ; } }
When cordova fires the deviceready event, we initialize everything needed for audio input.
When cordova fires the deviceready event we initialize everything needed for audio input .