Click here to Skip to main content
15,918,706 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Dears!
After lot's of weeks searching I found this about training sapi (all versions) but the problem is that I can't use ISpTranscript in C#
please help !
It's really an emergency (please consider that we must work with sapi through COM interop but I didn't find out how to connect to unmanaged sapi ISpTranscript beacuse it's methods had mixed me up!

<pre>
Create an inproc recognizer & bind the appropriate audio input.

Ensure that you’re retaining the audio for your recognitions; you’ll need it later.

Create a grammar containing the text to train.

Set the grammar’s state to pause the recognizer when a recognition occurs. (This helps with training from an audio file, as well.)

When a recognition occurs:

Get the recognized text and the retained audio.

Create a stream object using CoCreateInstance(CLSID_SpStream).

Create a training audio file using ISpRecognizer::GetObjectToken, and ISpObjectToken::GetStorageFileName , and bind it to the stream (using ISpStream::BindToFile).

Copy the retained audio into the stream object.

QI the stream object for the ISpTranscript interface, and use ISpTranscript::AppendTranscript to add the recognized text to the stream.
</pre>


really thanks
Posted

1 solution

faslesabz wrote:
It's really an emergency


You may be surprised to learn that nobody here shares your opinion on that. This looks very like a homework or exam question which is not something that this site is for. Try writing some code and comeback when you have a real issue and an answerable question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900