code: public void stopRecording() {
          IRecordingListener listener = null;
          if (recordingListener != null && (listener = recordingListener.get()).isRecording()) {
              sendRecordStopNotify();
              notifyRecordingStop();
              // remove the listener
              removeStreamListener(listener);
              // stop the recording listener
              listener.stop();
              // clear and null-out the thread local
              recordingListener.clear();
              recordingListener = null;
          }
      }
docs: Stops any currently active recording.