dispose method

Future<void> dispose()

Dispose the recorder

Implementation

Future<void> dispose() async {
  _amplitudeTimer?.cancel();
  _amplitudeStreamCtrl?.close();
  _amplitudeStreamCtrl = null;

  _stateStreamSubscription?.cancel();
  _stateStreamCtrl.close();

  if (_created != null) {
    await RecordPlatform.instance.dispose(_recorderId);
  }

  await _stopRecordStream();
}