如何在 Visual C#/C++ 中实现文本转语音 (TTS)?
我想用 Visual C#/C++ 编写一个简单的 Windows 应用程序,让用户输入不同的文本片段,然后按一组热键随时收听 TTS 中的各个文本片段。该程序应该在后台运行时接受热键,甚至在全屏应用程序具有焦点时也应接受热键。
示例用例:用户输入“hello world”并将其保存为第一个文本段,然后输入“stack Overflow”并将其保存为第二个文本段。用户可以切换到另一个程序,然后按热键 CTRL-1 听到 TTS 说“hello world”,或按 CTRL-2 听到 TTS 说“堆栈溢出”。该程序当然应该能够完全离线运行(以防影响任何建议)
作为旁注,我对 Visual 编程相当陌生,但在 C#/C+ 方面有足够好的背景,所以即使我我主要是在 TTS 部分寻求帮助,如果有人以前做过此类事情,我愿意接受任何类型的建议。
I want to write a simple Windows app in Visual C#/C++ that lets users input different segments of text, and then press a set of hotkeys to hear the various text segments in TTS at any time. The program should accept hotkeys while running in background or even when fullscreen applications have focus.
Example use case: user enters "hello world" and saves it as the first text segment, and then enters "stack overflow" and saves it as the second text segment. The user can switch to another program, then press hotkey CTRL-1 to hear the TTS say "hello world" or CTRL-2 to hear the TTS say "stack overflow." The program should of course be able to run entirely offline (just in case that affects any suggestions)
As a sidenote, I'm fairly new to programming in Visual whatever, but have a decent enough background in C#/C+, so even though I'm mainly looking for help on the TTS part, I'm open to suggestions of any kind if someone's done this kind of thing before.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你想谈论 C# 的内容,请使用
Introp.SpeechLib.dll
例如:
阅读以下内容:语音技术
if you want to talk something on C# use
Introp.SpeechLib.dll
E.g:
read this: Speech Technologies
参考
System.Speech.dll
。您可以实例化System.Speech.Synthesis.Synthesizer
并调用.Speak("TEXT HERE");
Reference
System.Speech.dll
. You can instantiate aSystem.Speech.Synthesis.Synthesizer
and call.Speak("TEXT HERE");
您必须使用 Microsoft 语音 SDK。
查看此链接了解详细信息:
http: //dhavalshah.wordpress.com/2008/09/16/text-to-speech-in-c/
You have to use the Microsoft Speech SDK.
Have a look at this link for details:
http://dhavalshah.wordpress.com/2008/09/16/text-to-speech-in-c/