stopVoiceInteraction method

  1. @override
void stopVoiceInteraction()
override

Stops the current voice interaction.

If the user is speaking, it stops listening and sends it to the AI.

If the AI is speaking, it stops speaking and starts listening to the user again.

Implementation

@override
void stopVoiceInteraction() {
  var rep = realtimeModel;
  if (rep == null) {
    return;
  }
  if (rep.isAiSpeaking) {
    rep.stopAiSpeech();
  } else {
    rep.commitUserAudio();
  }
}