admin管理员组文章数量:1415664
I'm trying the speech-to-text method, but the resulting text is in English.
9.0, CommunityToolkit.Maui 11.0
These are my codes:
public async Task<string> MediaToolKitSpeechToTextAsync()
{
var options = new SpeechToTextOptions
{
Culture = CultureInfo.GetCultureInfo("tr-TR")
};
await SpeechToText.Default.StartListenAsync(options, CancellationToken.None);
SpeechToText.Default.RecognitionResultCompleted += (s, args) =>
{
if (args.RecognitionResult != null && !string.IsNullOrEmpty(args.RecognitionResult.Text))
{
transcript = args.RecognitionResult.Text;
}
else
{
MainThread.BeginInvokeOnMainThread(async () =>
{
await DisplayAlert("Hata", "Ses anlaşılamadı.", "Tamam");
});
}
};
return transcript;
}
I'm trying the speech-to-text method, but the resulting text is in English.
9.0, CommunityToolkit.Maui 11.0
These are my codes:
public async Task<string> MediaToolKitSpeechToTextAsync()
{
var options = new SpeechToTextOptions
{
Culture = CultureInfo.GetCultureInfo("tr-TR")
};
await SpeechToText.Default.StartListenAsync(options, CancellationToken.None);
SpeechToText.Default.RecognitionResultCompleted += (s, args) =>
{
if (args.RecognitionResult != null && !string.IsNullOrEmpty(args.RecognitionResult.Text))
{
transcript = args.RecognitionResult.Text;
}
else
{
MainThread.BeginInvokeOnMainThread(async () =>
{
await DisplayAlert("Hata", "Ses anlaşılamadı.", "Tamam");
});
}
};
return transcript;
}
Share
Improve this question
edited Feb 10 at 10:52
Hakan DOĞAN
asked Feb 10 at 10:51
Hakan DOĞANHakan DOĞAN
54 bronze badges
1 Answer
Reset to default 0And finally, I found the bug. I replaced culture with tr_TR and done.
public async Task<string> MediaToolKitSpeechToTextAsync(){
var options = new SpeechToTextOptions
{
Culture = CultureInfo.GetCultureInfo("tr_TR")
};
await SpeechToText.Default.StartListenAsync(options, CancellationToken.None);
SpeechToText.Default.RecognitionResultCompleted += (s, args) =>
{
if (args.RecognitionResult != null && !string.IsNullOrEmpty(args.RecognitionResult.Text))
{
transcript = args.RecognitionResult.Text;
}
else
{
MainThread.BeginInvokeOnMainThread(async () =>
{
await DisplayAlert("Hata", "Ses anlaşılamadı.", "Tamam");
});
}
};
return transcript;
}
本文标签: mauiSpeechToText method does not provide Turkish resultsStack Overflow
版权声明:本文标题:maui - SpeechToText method does not provide Turkish results - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745219851a2648343.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论