Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] [Windows] SpeechToText.RecognitionResultCompleted never fires after StartListenAsync

Open lostmsu opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

RecognitionResultCompleted never fires and handler breakpoint is never hit

Expected Behavior

RecognitionResultCompleted is fired after recognizer decides user stopped talking

Steps To Reproduce

  1. Open MAUI samples project
  2. Put a breakpoint on HandleRecognitionResultCompleted method
  3. Launch it on "Windows Machine"
  4. Open "Essentials" -> "SpeechToText"
  5. Click "StartListenAsync"
  6. Say "Hello"
  7. Wait

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui

Environment

- .NET MAUI CommunityToolkit: 9.0.2
- OS: Windows 11 23H2
- .NET MAUI: 8.0.70

Anything else?

No response

lostmsu avatar Jul 11 '24 21:07 lostmsu

I added some logging around the state changed, it "hears me" but the result action never fires. ` CommunityToolkit.Maui.Media.SpeechToText.Default.StateChanged += async (sender, args) => { _log.LogInformation("STT State: " + args.State); if (args.State == SpeechToTextState.Stopped) {

      //  await STT.StartListenAsync(options, _cancellationToken);
    }
};

SpeechRecognitionCommunity: Information: STT State: Listening SpeechRecognitionCommunity: Information: STT State: Listening SpeechRecognitionCommunity: Information: STT State: Listening SpeechRecognitionCommunity: Information: STT State: Silence SpeechRecognitionCommunity: Information: STT State: Listening SpeechRecognitionCommunity: Information: STT State: Listening SpeechRecognitionCommunity: Information: STT State: Stopped SpeechRecognitionCommunity: Warning: Recognition completed failed? received NULLL!!!!!!!!!!!!!!!! `

This used to work and Im not sure when it stopped. It basically hears me, but when the final analysis should occur when it takes my voice and turns it into text, it stops, sends null, and just is over. I had tried to restart within that failure but it didn't result in any messages being sent out.

lancer1977 avatar Mar 17 '25 17:03 lancer1977