Repository: CommunityToolkit/Maui

Issue #2463: [BUG] OfflineSpeechToText Failure: LanguageNotSupported
Created: 2025-01-21T15:55:39Z
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
Using the unmodified sample provided, I try OfflineSpeechToText and receive a Failure in speech engine - LanguageNotSupported
Expected Behavior
Expect the sample to work and listen to speech
Steps To Reproduce
Press the button "StartListenAs" and the error appears in Language Output label
Link to public reproduction project repository
https://github.com/CommunityToolkit/Maui
Environment
Latest Community toolkit sample 11.0.0, tried on Android 13, 14 and 15.
Anything else?
Italian language devices, language pack downloaded in italian and english.
Tried:
await speechToText.StartListenAsync(new SpeechToTextOptions
{
Culture = new System.Globalization.CultureInfo("en-US"),
ShouldReportPartialResults = true
}, CancellationToken.None);
to force "en-US" and the default Culture = CultureInfo.CurrentCulture, that picks "it-IT"

Duplicate issue #2541: [BUG] Polish Language Speech Recognition Not Working
Created: 2025-02-20T10:07:18Z
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
I'm unable to get speech to text recognition with polish language, it works perfectly fine offline or online with "en-US". It throws "Request language is not supported error".
THIS REFERES TO ANDROID AND WINDOWS!
To my dismay, this feature works on Samsung A54 and with their native polish library, however with google package it's unable to work.
This is what i tried in code:
 await _speechToTextService.StartListenAsync( new SpeechToTextOptions() { // Culture = CultureInfo.GetCultureInfo("PL") // Culture = CultureInfo.CurrentCulture, Culture = CultureInfo.GetCultureInfo("pl-PL"), ShouldReportPartialResults = true, }, CancellationToken.None );
Also I've tried changing current culture of my PC to Polish and it petered away.
These are my windows settings:


I managed to debug external sources and here's the exact line when the error is thrown:
It's 117 line of SpeechRecognizer.cs (scenario with online speech recognition)

Expected Behavior
Being able to use speech to text with polish language, on windows 10/11 and android.
Steps To Reproduce

Open and run solution.
Press "Start the speech" button.
Error should be displayed in a label below.

Link to public reproduction project repository
https://github.com/wmassalski-arp/Polish-speech-online-recognition-bug/tree/main
Environment
- .NET MAUI CommunityToolkit: 11.1.0
- OS: Windows 10.0.19045 Build 19045, Windows 10 Pro 22H2 
(ANDROID: Android 14, 5.15.104-android13-3-27760517, UP1A.231005.007.A546BXX6BWL3, SM-A546B/DS) 
- .NET MAUI: 9.0
Anything else?
No response

Closing comment (2025-02-20T10:27:06Z): duplicate #2463