Tagged: suspendRecognition
- This topic has 11 replies, 2 voices, and was last updated 10 years, 1 month ago by Halle Winkler.
-
AuthorPosts
-
March 14, 2014 at 8:20 am #1020519vinay.chopra@tresbu.comParticipant
I am using OpenEars framework for speech recognition.
In my
viewdidload
method i am calling[self.pocketsphinxController startListeningWithLanguageModelAtPath:lmPath dictionaryAtPath:dicPath acousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”] languageModelIsJSGF:NO]; // Change “AcousticModelEnglish” to “AcousticModelSpanish” to perform Spanish recognition instead of English.
Now i want to suspend it
viewdidapper
method so i place a method call[self.pocketsphinxController suspendRecognition];
But still the recognition is not suspended, i placed a button on my VC and in function of that button is only to suspend the recognition and its working there with button but not with view did appear method.
Can anyone suggest the probable reason ?
Thanks in advance .
March 14, 2014 at 8:35 am #1020520Halle WinklerPolitepixWelcome,
Calls to suspend are ignored when listening isn’t in progress (you can probably see this explanation for why your call is being ignored if you turn on OpenEarsLogging). Listening won’t be in progress there because the call to suspend is coming milliseconds after the call to startListening and the listening startup takes a few seconds. You might have better luck if you put the call to suspend in your OpenEarsEventsObserver callback indicating that listening has begun.
March 14, 2014 at 8:41 am #1020521vinay.chopra@tresbu.comParticipantBasically i was trying to find a way that if the device is speaking then it should stop listening and once the speech of device is complete then it should start listening , Logic i applied in view did appear is:
[self.pocketsphinxController suspendRecognition];
[self.fliteController say:message withVoice:self.slt];
[self.pocketsphinxController resumeRecognition];
////i want my app should say welcome to the user and then ask the user do you want to continue say YES or NO ?
and then it should resume listening .
kindly help me with this logic.
March 14, 2014 at 9:04 am #1020522Halle WinklerPolitepixThat is done automatically by FliteController.
March 14, 2014 at 9:46 am #1020523vinay.chopra@tresbu.comParticipantIn my case i have put a statement in view did appear that will ask a question to user in YES/NO
at this scenario the listening should be suspended but the logs says that device is listening something and it takes words as input from the text what it is speaking , so i want to separate the device speech and user’s speech .A snippet will be helpful :)
March 14, 2014 at 9:57 am #1020524Halle WinklerPolitepixThe device speech causes listening for speech to be suspended so you don’t have to worry about having a secondary UI to manage it. You can see this working in the sample app (also a great source of snippets).
March 14, 2014 at 10:10 am #1020525vinay.chopra@tresbu.comParticipantHey still issue persist i have uploaded my source code which i am trying .
Check the logs once the view appear it ask the user for YES/NO and this is being processed as a speech text and taken as input.
Please check the source code on this link:
https://drive.google.com/file/d/0ByJ28nM_D2OgT25US2RUdE5jNDQ/edit?usp=sharing
March 14, 2014 at 10:16 am #1020526Halle WinklerPolitepixSorry, I can only look at very small source excerpts that can be put in this forum. Just check out the sample app, which performs this precise function of not performing recognition when speaking using FliteController by default. It’s only necessary to compare your implementation with the implementation there.
March 14, 2014 at 10:24 am #1020527vinay.chopra@tresbu.comParticipantThanks for the help ,
I need to use this function rather place voice data in in view did appear for the welcome speech:
– (void) pocketsphinxDidCompleteCalibration {
NSLog(@”Pocketsphinx calibration is complete.”);
[self instructUser:@”Do you want to read the NEWS , say YES or NO ?”];}
March 14, 2014 at 10:28 am #1020529Halle WinklerPolitepixTry not starting FliteController speech until speech recognition has started (using pocketsphinxDidStartListening instead of pocketsphinxDidCompleteCalibration).
March 14, 2014 at 10:31 am #1020530vinay.chopra@tresbu.comParticipantYup this was the issue , thanks for your suggestion and time.
cheers
March 14, 2014 at 12:03 pm #1020534Halle WinklerPolitepixGlad to help!
-
AuthorPosts
- You must be logged in to reply to this topic.