-
Notifications
You must be signed in to change notification settings - Fork 492
BUG] [IOS] OnRecognitionTextUpdated method returns incorrect words #2684
Copy link
Copy link
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- 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
current behaviour
OnRecognitionTextUpdated method returns incorrect words. For Eg : Fertilizers return as Ferets
if we take fertilizers -> its recognizing as Ferets -> Fertile -> Fertilizer -> Fertilzers. In InternalStartListeningAsync method there is a for loop which gives the result and its not iterating and reports the wrong results.
Expected Behavior
expected behaviour
OnRecognitionTextUpdated method should returns correct words.
Steps To Reproduce
Steps to reproduce
- implement speech to text
- say something like "Fertilizers" and have a breakpoint at OnRecognitionTextUpdated and check whats the result we are getting
Link to public reproduction project repository
Environment
- .NET MAUI CommunityToolkit:
- OS:
- .NET MAUI:
ENV
- .NET MAUI CommunityToolkit: 9.1.1
- OS: IOS 18.4.1
- .NET MAUI: 8.0.15
Anything to Add
if (result.Final)
{
currentIndex = 0;
StopRecording();
taskResult.TrySetResult(result.BestTranscription.FormattedString);
}
else
{
float confidence = 0f;
float duration = 0f;
for (var i = 0; i < result.BestTranscription.Segments.Length; i++)
{
var s = result.BestTranscription.Segments[i].Substring;
if (result.BestTranscription.Segments[i]?.Confidence > confidence && result.BestTranscription.Segments[i]?.Duration > duration)
{
recognitionResult?.Report(s);
}
}
}
tried to create a separate handler and done this workaround. kindly suggest any fixAnything else?
No response
Reactions are currently unavailable