pause method

Future<void> pause()

Use this to pause recording. Can start recording again after pausing.

Implementation

Future<void> pause() async {
  if (_recorderState == RecorderState.recording) {
    _isRecording = (await AudioWaveformsInterface.instance.pause()) ?? true;
    if (_isRecording) {
      throw "Failed to pause recording";
    }
    _timer?.cancel();
    _recorderState = RecorderState.paused;
  }
  notifyListeners();
}