如何使用 System.Speech.Synthesis 更改音频设备
我正在尝试使用 System.Speech.Synthesis 播放文本,然后通过 Tapi 调制解调器输出。
SetOutputToDefaultAudioDevice() 很容易理解,但我不希望声音从扬声器中发出。
我想我需要使用 SetOutputToAudioStream,但我不确定如何使用它,也找不到任何示例...
我尝试更改控制面板中的默认设备,但这也不起作用:(
Insight有人吗?
谢谢
I'm trying to use System.Speech.Synthesis to play text that is then output over a tapi modem.
SetOutputToDefaultAudioDevice() is easy enough to figure out, but I don't want the sound to come out of the speakers.
I think i need to use SetOutputToAudioStream, but I'm not sure how to use it and I can't find any examples ...
I tried changing the default device in the control panel, but that didn't work either :(
Insight anyone?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否在此处查看了答案?它有一个简短的例子。
另外 - 如果您的调制解调器支持 TAPI,您应该查看 Windows SDK 中的示例,特别是 %windowssdkdir%\Samples\winui\speech\simpletelephony 中的简单电话示例。这是用 C++ 编写的,但它演示了如何获取调制解调器的音频设备 ID 以及如何设置 SAPI 音频流的设备 ID。
Have you looked at the answers here? It has a brief example.
Also - if your modem supports TAPI, you should review the samples in the Windows SDK, in particular, the Simple Telephony sample in %windowssdkdir%\Samples\winui\speech\simpletelephony. This is written in C++, but it demonstrates how to get the audio device ID for the modem and to set the device ID for SAPI's audio stream.
您可以在控制面板->语音识别->文本到语音->高级中更改文本到语音的输出。然后选择“使用此音频输出设备”并选择音频设备将文本输出为语音。
You can change output of text to speech in control panel->speech recognition->text to speech->advanced. Then select "Use this audio output device" and select audio device to output text to speech.