views:

43

answers:

2

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

A: 

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.

Eric Brown
A: 

Unfortunate, the manufacturer of the modem does not provide an api. It simply uses a microsoft modem driver. I'm currently using a the Microsoft SpeechLib.dll library to accomplish the speech portion of my program. This lib lets you set the audio device id. However, it's not quiet working correctly. That's why I'm trying the System.Speech.Synthesis instead, but now I'm having problems changing the audio device.

Eric Brown, I checked out the MemoryStream Class, but I don't understand how to get the data in the MemoryStream object to play to my modem ... Is there a way to write the data in the MemorySteam to modem device?

Tony Presnow
There are two parts to your problem: 1) sending *any* audio data to your modem; and 2) sending *speech* audio data to your modem.The problem here is that you haven't described how part 1 works. Once you get part 1 working, we can help you with part 2.
Eric Brown