Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text2Speech, how?

Status
Not open for further replies.

alcyone

Programmer
Sep 6, 2000
33
Hi there,

In my windows XP Control Panel, I have an item called 'Speech', where I can test text to speech conversion. Is there a (easy) way to use this feature in C++, by calling a function or so? I think I've to use DirectX, but have no experience with it.
Thanks for any answers!
 
If you have that on your PC that means you have C:\Program Files\Common Files\Microsoft Shared\Speech\SAPI.dll installed and you can use to implement what you want by adding it as reference in your project and use of SpeechLib as well the SpSharedRecoContext , ISpeechRecoContext , ISpeechRecoGrammar , ISpeechGrammarRule classes to create a SpSharedRecoContext object.
Add handlers for the following events: AudioLevel, Recognition.
Set the EventInterests property in a SpSharedRecoContext object.
Call CreateGrammar() on the SpSharedRecoContext object to load a grammar for a given file or specify that programmatically at run time.
-obislavu-

 
Hi Obislavu,

Thanks for your answer! I indeed had the SAPI.dll, but was missing the Microsoft Speech SDK. I've downloaded it and now it's rather easy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top