如何选择习语来理解我的语音识别软件c#
本文关键字:我的 语音识别 软件 习语 何选择 选择 | 更新日期: 2023-09-27 18:11:22
好了,大家好,我现在做了一个小ap语音识别,但现在他只理解西班牙语,如果我用英语说话,他把随机单词放在文本框列表上,你现在如何让他也理解英语,我怎么能让他明白我一点清楚吗?
public partial class MainWindow : Window
{
private SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine();
public MainWindow()
{
InitializeComponent();
}
private void ButtonStart(object sender, RoutedEventArgs e)
{
recognizer.SetInputToDefaultAudioDevice();
recognizer.LoadGrammar(new DictationGrammar());
recognizer.SpeechRecognized += recognizer_SpeechRecognized;
recognizer.RecognizeAsync(RecognizeMode.Multiple);
}
void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
foreach (RecognizedWordUnit word in e.Result.Words)
{
listBoxResult.Items.Add(word.Text);
}
}
}
}
可以重载SpeechRecognitionEngine(CultureInfo)
实例
例如:
private SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine(new CultureInfo("en-EN"));