Tag: 文本到语音

C#SAPI 5.4语言?

我已经制作了一个使用SAPI 5.4识别语音的简单程序,我想问一下我是否可以为TTS和ASR添加更多语言,谢谢以下代码我让你任何人都需要看看它 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using SpeechLib; using System.Globalization; using System.Speech.Recognition; namespace WindowsFormsApplication1 { public partial class Form1 : Form { // Speech Recognition Object SpSharedRecoContext listener; // Grammar object ISpeechRecoGrammar grammar; public Form1() { InitializeComponent(); } public string ps; private void […]

问SpeechSynthesizer.SetOutputToAudioStream音频格式问题

我目前正在开发一种应用程序,它需要传输编码为特定音频格式的语音。 System.Speech.AudioFormat.SpeechAudioFormatInfo synthFormat = new System.Speech.AudioFormat.SpeechAudioFormatInfo(System.Speech.AudioFormat.EncodingFormat.Pcm, 8000, 16, 1, 16000, 2, null); 这表明音频采用PCM格式,每秒8000个采样,每个采样16位,单声道,每秒16000个平均字节,块对齐为2。 当我尝试执行以下代码时,没有任何内容写入我的MemoryStream实例; 但是当我从每秒8000个样本更改为11025时,音频数据被成功写入。 SpeechSynthesizer synthesizer = new SpeechSynthesizer(); waveStream = new MemoryStream(); PromptBuilder pbuilder = new PromptBuilder(); PromptStyle pStyle = new PromptStyle(); pStyle.Emphasis = PromptEmphasis.None; pStyle.Rate = PromptRate.Fast; pStyle.Volume = PromptVolume.ExtraLoud; pbuilder.StartStyle(pStyle); pbuilder.StartParagraph(); pbuilder.StartVoice(VoiceGender.Male, VoiceAge.Teen, 2); pbuilder.StartSentence(); pbuilder.AppendText(“This is some text.”); pbuilder.EndSentence(); pbuilder.EndVoice(); […]

‘SAPI不实现语音字母选择’例外

每当我尝试在我的笔记本电脑中编写任何语音识别程序时,我总会得到与下面提到的相同的消息。我总是可以编译我的代码并使Windows窗体应用程序正常工作。但问题是,程序无法检测到我的声音……程序不会工作.. 我非常确定我的代码工作正常,因为我通常从youtubevideo中获取代码: https : //www.youtube.com/watch?v = KR0-UYUGYgA等等。我使用的是.NET framework 4客户端配置文件对于我的项目..我只参考“system.speech”……可能是我的问题? 我得到的调试消息: speaker.vshost.exe Information: 0 : SAPI does not implement phonetic alphabet selection. A first chance exception of type ‘System.Runtime.InteropServices.COMException’ occurred in System.Speech.dll A first chance exception of type ‘System.InvalidOperationException’ occurred in System.Speech.dll A first chance exception of type ‘System.InvalidOperationException’ occurred in System.Speech.dll A first chance exception […]

SpeechSynthesizer无法获得所有已安装的声音

我在我的Windows 7 64位操作系统中安装了一个新的32位Scansoft语音(Jennifer),以便能够在我正在开发的一个.NET应用程序中使用。 问题是我在调用方法时: List allInstalledVoices = new SpeechSynthesizer().GetInstalledVoices(); 我只收到一个声音,默认的Microsoft Anna Voice。 但是我可以在其他文本到语音应用程序中看到所有已安装的声音。