-
Notifications
You must be signed in to change notification settings - Fork 463
SpeechRecognition fixes #2562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpeechRecognition fixes #2562
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR fixes issues related to speech recognition support across multiple platforms by updating API usages and converting several void methods to asynchronous Tasks. Key changes include updating Android platform version requirements and adding asynchronous support with task-based patterns, as well as corresponding updates in macOS, iOS, .NET, Windows, and Tizen implementations.
Reviewed Changes
| File | Description |
|---|---|
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.android.cs | Converted InternalStartListening to async Task, updated Android version requirements, and added task-based callbacks for on-device language model download. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.android.cs | Updated language configuration and switched to async Task for InternalStartListening. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.macos.cs | Changed InternalStartListening to asynchronous, returning Task.CompletedTask. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.ios.cs | Converted InternalStartListening to async Task and returned Task.CompletedTask. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.net.cs | Updated InternalStartListening signature to Task and preserved unsupported behavior. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.windows.cs | Changed InternalStartListening to async Task with Task.CompletedTask return. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.tizen.cs | Updated InternalStartListening to async Task with Task.CompletedTask return. |
| src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.shared.cs | Updated the StartListenAsync method to await the asynchronous InternalStartListening implementation. |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
...munityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.android.cs
Show resolved
Hide resolved
...munityToolkit.Maui.Core/Essentials/SpeechToText/OfflineSpeechToTextImplementation.android.cs
Show resolved
Hide resolved
|
I have found a bug with windows implementation of Speech to text page. If you run the app and test speech to text and then close the app it crashes to desktop. Current main does not do this. But current main also does not work for me at all with speech recognition in any language. 2025-03-07.03-04-37.mp4edit: I tested it again and if I use speech to text and then leave page and then exit app it still crashes 100 percent of the time. |
|
@ne0rrmatrix there is an open issue for that. not related to this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On windows the changes do exactly what is intended. The offline speech recognition works. the online speech recognition works. Current main I cannot get either offline or online speech recognition to work with windows.
On android I have zero issues with using this PR. I have been unable to test other languages specifically as I only speak English.
So this is a great fix! I have seen a bug in windows where the app crashes 100 percent of the time if you use online speech recognition. But once that is fixed I think this will be good to go!
|
This one is primarily the Android-only fix. This issue #1894 will be fixed in another PR |
I tested the android version. It is working 100 percent for me with this PR. But I am unable to test other languages because I only speak english. It actually works better on android than on windows. Most likely due to my Mic is not configured properly for silence detection on windows. I have multiple mics on windows and the one I use daily is an xlr mic with a usb interface and I use Nvidia software interface on top of that. So an edge case that also works! If you need anyone to test another language I cannot help. But for what I was able to test everything works On android and windows. If anyone can confirm the language packs working I will be happy to approve this PR. |
|
@ne0rrmatrix I attached video in summary demonstration Ukrainian speech recognition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like another great PR is ready to go! I am happy to approve this PR. I have tested the changes on windows and android. It just works as intended. After looking at the video that @VladislavAntonyuk provided shows other languages I have no concerns.
Description of Change
Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
Untitled.video.2.mp4