stop method

Future<Uint8List> stop()

Stop recording and return audio data.

Implementation

Future<Uint8List> stop() async {
  if (!_isRecording) return Uint8List(0);

  _isRecording = false;
  _process?.kill(ProcessSignal.sigterm);
  await _process?.exitCode;
  _process = null;

  return Uint8List.fromList(_buffer);
}