HomeForumsOpenEars[Resolved] Best practices for multiple views

This topic has 2 voices, contains 8 replies, and was last updated by  Halle 233 days ago.

Viewing 9 posts - 1 through 9 (of 9 total)
Author Posts
Author Posts
September 28, 2011 at 8:37 am #7624

mcoulman

Any pointer or suggestions about getting speech input from multiple views? I have a top level UITableViewController (form manager), with a 2d TVC (form’s field instances) and would like to use speech input in both. I’ve tried (unsuccessfully) to share instances of pocketsphinxController & openEarsEventsObserver, and reset the delegate. Also tried to create separate instances of pocketsphinxController & openEarsEventsObserver in each TVC.  Neither works as expected.

I’d be interested in anyone who has this scenario worked out, or suggestions on how to get better results.

Great project, TIA for any ideas.

September 28, 2011 at 9:18 am #7626

Halle

Hi,

The design of the library is that you use a single instance of PocketsphinxController somewhere that always remains instantiated at the same time as your child views (multiple instances of PocketsphinxController will not work and aren’t intended to do so) and then you use multiple instances of OpenEarsEventsObserver by making whatever view controller needs speech information into a delegate of it and using its delegate methods.

Please describe in specific terms how your multiple instances of OpenEarsEventsObserver didn’t work as expected when they were used with only one instance of PocketsphinxController that you are sure was instantiated and working, and I might be able to give you some pointers.

September 28, 2011 at 7:29 pm #7628

mcoulman

I haven’t yet tried the approach you suggest, only sharing both or instantiating both. I’ll give this a try and update later with results.

Hat tip for the advice.

September 28, 2011 at 8:19 pm #7629

mcoulman

Halle,

The approach you outline keeps the main thread active. and the openEarsEventsObserver.delegate operations fire in the 2d view.

However, after calling pocketsphinxController startListeningWithLanguageModelAtPath: from viewWillLoad in 2d view, 2d view’s openEarsEventsObserver.delegate pocketsphinxDidCompleteCalibration fires, but pocketsphinxDidStartListening does not.

Got a clue for me?

September 28, 2011 at 8:38 pm #7630

Halle

Hi,

Does 2d view = 2nd view? Does the PocketsphinxController actually start listening or is the delegate method not called because it isn’t actually listening? You can check this by turning on all logging.

September 28, 2011 at 9:21 pm #7631

mcoulman

Yes 2d = 2nd.

I’ll give the logging a shot.

I do believe the delegate is listening, since its emitting NSLog’s from entering main recognition loop, starting calibration, and completing calibration.

Thanks again.

September 28, 2011 at 9:55 pm #7632

Halle

OK, my question isn’t whether the delegate is listening, but whether the PocketsphinxController is actually getting to the listening stage after calibration. The OpenEarsEventsObserver delegate method might not be firing, not because there is an issue with the OpenEarsEventsObserver delegate, but because listening isn’t actually starting. What you want to do is turn on OPENEARSLOGGING and VERBOSEPOCKETSPHINX and see whether the issue is that the app is listening but it isn’t calling the delegate method for some reason, or if it is simply not able to start listening at all.

September 28, 2011 at 10:02 pm #7633

mcoulman

Found the issue once I turned on logging: an extra call to stopListening in the main view.

Its all good now. Thanks for the help and pointers.

September 28, 2011 at 10:07 pm #7634

Halle

No prob, glad the logging cleared it up.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.