0

I am performing speech recognition on wave files, searching for a total or partial match of a given sentence.

The program takes as input - a Wave file - a Sentence and should return a 0.0 to 1.0 "matching confidence" value.

1) I create an InProcRecognizer 2) I create a ISpeechRecoContext from the InProcRecognizer 3) I connect the Context to the Recognizer 4) I create a SPFileStream and point it to the Wav file 5) I point the Recognizer to the SPFileStream through AudioInputStream

At this point, several hypothesis events are fired, and the recognition is already fairly correct.

However this is working without a grammar at all.

Now, I suppose that, to limit recognition to a specific sentence, I should work with a grammar. I know how to create a new empty one programmatically, but I am at a loss on what to do next.

I have searched everywhere and can't find a clear direction or tutorial (actually most of the code out there is severely outdated and referring to Sapi 5.0 from 14 years ago)

resle
  • 2,254
  • 4
  • 19
  • 37
  • Interesting q, even if it doesn't really fit the SO format very well. Have you tried googling the title of your q? – MartynA Jan 22 '16 at 10:37
  • Yes, sorry. I am aware the centerpiece here is code, but there's little to share here. Yes I have googled the title of my question... and in several languages too. I use SO as the very last resort. – resle Jan 22 '16 at 10:41
  • Perhaps it would help you getting a useful answer for your q to say why the more relevant-looking things google finds don't help? Anyway, good luck! Btw, also try googling "Sapi 5.4 sentence grammar" – MartynA Jan 22 '16 at 10:44
  • as I pointed out, most of the results present code from Sapi 5.0, which seems to be working in radically different ways compared to Sapi 5.4 despite the major version number stays the same. Lots of deprecated functions and structures. More specifically, a great help would come in the form of an explanation of: 1) How to add a new rule to a grammar dynamically 2) What kind of rule would fit the "exact sentence recognition" scenario. – resle Jan 22 '16 at 10:52
  • maybe you already know about this... but in case you don't: https://msdn.microsoft.com/en-us/library/ee125667(v=vs.85).aspx – fantaghirocco Jan 22 '16 at 12:53
  • 1
    The phrase to look for is "keyword spotting". You can find some examples here http://stackoverflow.com/questions/10377054/how-to-recognize-a-phrase-from-a-voice-file/10379351#10379351 – Nikolay Shmyrev Jan 23 '16 at 14:26

0 Answers0