简体   繁体   中英

how to Implement the ISpeechPhraseElement from sapi 5.1 in c#?

I need to implement the ISpeechPhraseElement so that i can use the AusioStreamOffset

http://msdn.microsoft.com/en-us/library/ee125345(v=vs.85).aspx

in c# so that i can get the current offset but i dont have any idea how i can do it as all example on the.net are all made in vb. Ill be gratefull if someone can put me in the right direction. i need this for a text to speech in a web application. 10x alot.

You can only find VB samples because you would only use SAPI from a scripting language, like VBScript. In C# you use the classes in the System.Speech.Recognition namespace. It contains managed class wrappers around the SAPI interfaces. The equivalent of ISpeechPhraseElement is the RecognizedUnitWord class. Instances of which you get out of RecognitionResult.Words property.

Check out the sample code included with this MSDN article to get started.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM