Break in logic to ask for voice input?

Home Forums OpenEars Break in logic to ask for voice input?

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

  • Author
    Posts
  • #1015859
    Romines
    Participant

    Hello,

    I have what might be a really silly question, but if it’s possible, it would help me out a ton.
    I have a for loop that displays questions on the screen one at a time, but I need to be able to break out of the for loop in order to ask the user for the answer to the question on the screen. Is this possible and how?

    Thank you very much for any help you are able to give.

    #1015861
    Halle Winkler
    Politepix

    Hi,

    Does the question relate to OpenEars specifically or is it about Objective-C in general?

    #1015877
    Romines
    Participant

    I suppose it could relate to both because I do not know what method to call to get more voice input from the user

    #1015878
    Halle Winkler
    Politepix

    Voice input is listened for continuously in OpenEars, but if you want to temporarily stop listening you can look into the suspendListening/resumeListening methods of PocketsphinxController.

    #1015879
    Romines
    Participant

    I knew about the suspend and resume listening methods but how do I pause the for loop and wait until the user gives input?

    #1015880
    Halle Winkler
    Politepix

    I would genuinely like to be able to help with this kind of app design logical flow question but I’m afraid it’s beyond what I can offer support for. If you definitely need to exit your loop for every question, you don’t really want a loop but some kind of delegate callback or NSNotification pattern. But there is also no inherent reason that you should have to exit a loop in order to call other functionality in the course of your app. I have to recommend investigating patterns for logical flow in an app — I think there is some good stuff at the Apple developer site, and please feel free to bring more questions here that are about OpenEars specifically.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.