code: 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();
      }
  }
docs: When cordova fires the deviceready event, we initialize everything needed for audio input.