endTranscription method

  1. @override
Future<void> endTranscription()
override

Implementation

@override
Future<void> endTranscription() async {
  if (!voiceRecorder.isRecording) {
    return;
  }
  var file = await voiceRecorder.stop();
  var transcription = await transcribeFromFile(file);
  _streamController.add(transcription);
  _streamController.close();
  _streamController = StreamController<String>();
}