CommunityToolkit / CommunityToolkit/Maui
[BUG] [Android] SpeechToText: StartListenAsync silently no-ops after auto-stop via silence detection
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### 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
After a speech recognition session ends via automatic silence detection, calling StartListenAsync a second time silently returns without starting the recognizer. The caller receives no error, no event, and no indication that recognition did not start. A subsequent call to StopListenAsync produces the Android system warning "[SpeechRecognizer] not connected to the recognition service."
Only a third call to StartListenAsync succeeds.
### Expected Behavior
Calling StartListenAsync should successfully start a new recognition session regardless of how the previous session ended (silence detection, manual stop, or error).
### Steps To Reproduce
1. Call StartListenAsync — recognition works correctly
2. Wait for the session to end automatically via silence detection (AutoStopSilenceTimeout)
3. Call StartListenAsync again — method returns silently, no recognition occurs, no error is raised
4. Call StopListenAsync — Android logs [SpeechRecognizer] not connected to the recognition service
5. Call StartListenAsync a third time — recognition works correctly again
### Link to public reproduction project repository
none
### Environment
```markdown
- .NET MAUI CommunityToolkit: 14.1.1
- OS: Android 10
- .NET MAUI: 10.0.203
```
### Anything else?
Fix: In SpeechRecognitionListener.OnResults(), set speechToText.CurrentState = SpeechToTextState.Stopped after invoking Results, mirroring what OnError() already does.
Contributor guide
Assessment
This issue has not been assessed yet.