How do you change the audio device in using System.Speech.Synthesis
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
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.
精彩评论