- This topic has 8 replies, 2 voices, and was last updated 11 years, 5 months ago by Halle Winkler.
-
AuthorPosts
-
October 13, 2012 at 5:08 am #11604cgunnParticipant
Inside pocketsphinxDidReceiveHypothesis I am seeing the error message
aq@0x90ee000: ConvertInput using invalid anchor timeAnd if OpenEarsLogging is turned on, it is then followed by
Error -66681: Unable to start the Audio Queue.This error appears when I make the first method call out from within the pocketsphinxDidReceiveHypothesis method.
For example, I create a simple method, dummy(), which gets called from within pocketsphinxDidReceiveHypothesis. The error appears when this method is called:
– (void) pocketsphinxDidReceiveHypothesis:(NSString *)hypothesis recognitionScore:(NSString *)recognitionScore utteranceID:(NSString *)utteranceID {
[self dummy]; /// DEBUG
…..
…..And from that point on, no fliteController output occurs and no more speech recognition occurs.
My code has previously worked fine, so It seems to be something I have changed, but I have been unable to track down what it is. Any suggestions?October 13, 2012 at 5:33 am #11605cgunnParticipantOK, I’ve discovered something more about this. This error seems to occur because the class that this code is in is both an OpenEarsEventsObserverDelegate and an AVAudioPlayerDelegate.
@interface Speech : NSObject
This is because it plays some pre-recorded sound clips as well as fliteController output, and I want to know when the clips are started and finished so i can turn off speech recognition during those sounds.
If I remove the ‘AVAudioPlayerDelegate’, I seem to be able run consistently without the error occurring.Is it valid to have the class as a delegate of both? Could there be some conflict that is causing this error and lock-up?
October 13, 2012 at 10:12 am #11607Halle WinklerPolitepixInteresting. We know that there isn’t an inherent conflict between a class inheriting the delegate protocols of OpenEarsEventsObserver and AVAudioPlayer because FliteController inherits the delegate protocols of both. But I don’t think your interpretation is offbase because there is a lot going on there — the recognition audio unit, FliteController’s audio and its callbacks, and your audio and its callbacks.
Do you want to show me some logs featuring OpenEarsLogging and verbosePocketSphinx for the timeframe in which this is occurring? Maybe there are some hints.
Something to just double-check is that a lot of AVAudioPlayer sample code contains unneeded calls to AVAudioSession and a lot of developers who asked me about similar issues found calls to the audio session in their code that were responsible. It might be worth a quick project-wide search for “audiosession” without case matching to make sure that some audio session overrides didn’t sneak in there.
October 14, 2012 at 5:48 am #11610cgunnParticipantOK, I’ve done what you suggested, but first, something didn’t paste correctly in my earlier message, because it got the angle brackets confused with html brackets. The line
@interface Speech : NSObject
should have shown as
@interface Speech : NSObject {OpenEarsEventsObserverDelegate, AVAudioPlayerDelegate}
(except replace the braces with angle brackets).A search for AudioSession revealed the two methods: audioSessionInterruptionDidBegin and audioSessionInterruptionDidEnd, but commenting them out didn’t fix the problem. Here is the output:
2012-10-14 15:36:19.525 RR[66801:c07] VC Pocketsphinx calibration is complete.
2012-10-14 15:36:19.526 RR[66801:c07] Speech: Pocketsphinx calibration is complete.
2012-10-14 15:36:28.107 RR[66801:1f07] Speech detected…
2012-10-14 15:36:29.864 RR[66801:1f07] Processing speech, please wait…
2012-10-14 15:36:29.869 RR[66801:1f07] Pocketsphinx heard “START” with a score of (-1557) and an utterance ID of 000000000.
2012-10-14 15:36:29.870 RR[66801:c07] The received hypothesis is START with a score of -1557 and an ID of 000000000— here i make a call to my dummy() function – (void) dummy { NSLog(@”dummy”);} —
2012-10-14 15:36:40.707 RR[66801:1f07] aq@0x9671000: ConvertInput using invalid anchor time
Error -66681: Unable to start the Audio Queue.
2012-10-14 15:36:40.708 RR[66801:1f07] Listening.
2012-10-14 15:36:40.708 RR[66801:c07] dummyOctober 14, 2012 at 6:21 am #11613cgunnParticipantAlso, the above output is followed by the line
2012-10-14 16:15:29.380 RR[68064:c07] Flite sending interrupt speech request.
before returning to the main loop.
And to complicate it a bit more, i have now removed the inheritance from AVAudioPlayerDelegate, which fixed the problem yesterday, but now i am still getting the error – so it may not have been the cause.
October 14, 2012 at 9:55 am #11614cgunnParticipantI’ve now discovered that it seems to be to do with having 2 OpenEarsEventsObserverDelegates in the system. I had my main ViewController as an OpenEarsEventsObserverDelegate so that it can change the user interface when fliteController output starts and stops. i also had another class, Speech, as a second OpenEarsEventsObserverDelegate so that it can process the speech. In my view controller, if i set the delegate to ‘this’, the error occurs, but if i omit that line (leaving only one delegate in the system – the Speech class), the error does not occur. So i think i can reorganise my code to have only one delegate and have it inform the other class of the OpenEars events when they occur.
October 14, 2012 at 10:31 am #11615Halle WinklerPolitepixThat is a little bit unlikely as the underlying cause since OpenEars itself has at least two OpenEarsEventsObservers instantiated internally, then add your first one and you’re up to a minimum of three out of the gate.
Not debating that it is helping the issue you are seeing, just that it is probably ultimately due to something else. I haven’t seen the full logs and I imagine there are nuances to the code that can’t be put across via small snippets but it would be great if you could email me a stripped-down test case. Looking at this report of the same issue, it really looks like the audio session category is being overridden somewhere:
November 27, 2012 at 4:25 am #13605cgunnParticipantThanks for this answer – I’m sure you are right – there must have been some memory corruption somewhere that was causing this side effect. I have now completely rewritten my app and have not (yet!) seen the problem.
November 27, 2012 at 11:40 am #13608Halle WinklerPolitepixCool, I’m glad to hear you’ve seen an improvement and I appreciate your updating the thread.
-
AuthorPosts
- You must be logged in to reply to this topic.