Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is there a way to get the time a spoken word was recognized in speech recognition?
I am using C#, and the SAPI5.1

So far, I found this
C#
decimal position = (decimal)sfs.Seek(0, SpeechStreamSeekPositionType.SSSPTRelativeToCurrentPosition)



from here

I haven't tried it yet
but I want my output to look something like

word 0:01
word1 0:02

Thank you to for your advice and answers =)
Posted
Comments
Sergey Alexandrovich Kryukov 9-Jul-11 21:59pm    
Good question, my 5.
--SA

When the speech regonition identifies a word you can create a timestamp

You can use the current time with DateTime:
http://msdn.microsoft.com/en-us/library/efez4684.aspx[^]

Or you can use a timer,
http://msdn.microsoft.com/en-us/library/system.timers.timer(v=VS.100).aspx[^]

Regards.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Jul-11 22:00pm    
Correct, my 5, but more exactly --- see my solution.
--SA
thatraja 9-Jul-11 23:55pm    
My 5 man.
You can time stamps several different events raised on different phases of recognition: SpeechDetected, SpeechHypothesized, SpeechRecognitionRejected and SpeechRecognized. Those are the events of the classes System.Speech.Recognition.SpeechRecognitionEngine or System.Speech.Recognition.SpeechRecognizer, whichever you use.

You can use timestamps to figure out the position of the recognized word in audio stream, see the property RecognizerAudioPosition and the property Result.Audio you receive in the event argument parameters of the recognizer events.

See:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognitionengine.aspx[^],
http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognizer.aspx[^],
http://msdn.microsoft.com/en-us/library/system.speech.recognition.recognizedaudio.aspx[^].

As S Houghtelin already explained, you can use System.DateTime for time stamps.

—SA
 
Share this answer
 
v2
Comments
Wonde Tadesse 9-Jul-11 23:26pm    
5+
Sergey Alexandrovich Kryukov 10-Jul-11 0:24am    
Thank you, Wonde.
--SA
thatraja 9-Jul-11 23:54pm    
Bookmarked, Nice solution. 5!
Sergey Alexandrovich Kryukov 10-Jul-11 0:24am    
Thank you, Raja.
--SA
Espen Harlinn 10-Jul-11 14:10pm    
Nice reply, my 5

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