code: function listen() {
      // Callers should only listen after receiving
      // the 'ready' state event, so we can ignore
      // their requests if we're not ready.
      if (state !== "ready") {
        console.warn("Listen() called when not ready");
        return;
      }
  
      // Lazy init VAD on first-use
      // TODO: Fix VAD re-use. Fails for some reason on successive use.
      /*
      if (config.vad && !VAD) {
        function onVADComplete(reason) {
          console.log('onVADComplete', reason);
          vadReason = reason;
          stop();
        }
        VAD = SpeakToMeVAD({
          listener: onVADComplete
        });
      }
      */
  
      // Configure constraints
      var constraints = {audio: true};
  
      // Start listening
      navigator.mediaDevices
        .getUserMedia(constraints)
        .then(onStream)
        .catch(function(err) {
          updateState({state: "error", error: err});
          updateState({state: "ready"});
        });
    }
docs: Start recording