当我试图运行时,这是我一直在这一行上得到的错误消息:
recognitionEngine.LoadGrammar(GrammarBuilder());
错误:
The language for the grammar does not match the language of the speech recognizer.
我到处寻找,但我似乎找不到答案!
在语音识别属性中,我有两个语言选项:
Microsoft语音识别器8.0 for Windows (英语-英国)
Microsoft语音识别器8.0 for Windows (英语-美国)。
只有当我将设置为English
我正在尝试将音频转换为文本。音频不是英语,而是荷兰语。我无法将荷兰语音频转换为文本。该代码仅适用于英语音频。我不确定是否需要在代码中包含一些函数或选项来识别其他语言。代码如下: import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile('audio.wav') as source:
audio = r.listen(source)
try:
text = (r.recognize_google)
print(text)
我想尝试用语音识别来控制程序。我用C#编写了测试程序,当我调试这个程序时,每次都会发生错误-
System.Runtime.InteropServices.COMException (0x80004005): Calling part of COM return error HRESULT E_FAIL.*
in System.Speech.Recognition.RecognizerBase.Initialize(SapiRecognizer recognizer, Boolean inproc)
in System.Speech.Recognition.SpeechRecognition
我在我的Python应用程序中使用SpeechRecognition。但是,它只能识别英语。我希望它也能识别其他语言。我知道这是有可能的。有人可以帮助我在Python2.7中改变语音识别语言的语法吗?请帮助!提前谢谢。到目前为止,我的代码如下:
import speech_recognition as sr
r = sr.Recognizer()
with sr.Microphone() as source:
try:
audio = r.listen(source)
text = r.recognize_google(audio)
except
我想用混合语言输入来做演讲<->文本。
最初只有中文和英文,但最终会有更多的语言对。绝大多数的演讲将是英语,但少量的中文将被包括在内。该应用程序类似于“会话式语言词典”:
用混合语言输入的语音到文本:“你怎么说猫?”
用混合语言输入的文本到语音:“猫的英文单词是猫.”我希望能用以英语为母语的人的声音/口音来说话。
- I noticed that the text-to-speech demo at [this URL](https://www.microsoft.com/cognitive-services/en-us/speech-api) can handle
虽然在一般情况下,我们在Bluemix方面取得了很好的成功,但我们在尝试识别偶尔出现的非英语单词(例如,外国姓氏)时遇到了一些问题。我们希望可以使用SPR拼音符号来指定关键字列表(这对于text2speech非常有用),但似乎不支持speech2text。有什么建议/解决办法吗?
SpeechToText service = new SpeechToText();
service.setUsernameAndPassword("USERNAME", "PASSWORD");
File audio = new File("C:\\Users\\Audio
我目前正在开发一个在C#中实现文本到语音的小程序.但是,我发现有两个名称空间可以使用:
System.Speech.Synthesis
Microsoft.Speech.Synthesis
我在谷歌上搜索了不同之处,并找到了关于语音识别的帖子。它并没有真正回答我的问题。我也转换了他们之间,没有差别。它适用于代码中的所有语言(如下所示)。
using System;
using System.Speech.Synthesis;
//using Microsoft.Speech.Synthesis;
namespace TTS_TEST
{
class Program
{
我在学习语音识别。我用的是System.Speech
这是代码:
var currentCulture = (from r in SpeechRecognitionEngine.InstalledRecognizers()
where r.Culture.Equals(Thread.CurrentThread.CurrentCulture)
select r.Culture).FirstOrDefault();
recognizer = new Speech
我正在编写一个程序,它从一个文件中生成语音识别语法,并将这些短语存储在字典中,其中键是短语。以下代码:
sre.LoadGrammarAsync(new Grammar(new GrammarBuilder(new Choices(commands.Keys.ToArray()))));
抛出此异常:
System.InvalidOperationException: The language for the grammar does not match the language of the speech recognizer.
vid System.Speech.Recognitio