Menu

pocketsphinx iphone

Help
mike pfaff
2015-11-18
2015-11-28
  • mike pfaff

    mike pfaff - 2015-11-18

    I have an app “MikesTennisCoach” running great using Android demo to record tennis stats as a player is playing a match. I have the same app running on iphone using openears. My problem is that openears will not let me control recognition time as I can with the Android demo. I need the recognizer to listen for 5 seconds and then give me the results. Openears stays open due to background noise on tennis court.

    I have generated Sphinx libraries on mac. I am using the source code from VocalKit which I have updated. I have the app working using pocketsphinx with the simulator. I have build an ad hoc .ipa and installed on my Iphone 5 using armv7.

    My problem is that when I press the Icon the app goes directly to background. I suspect it is something I did building the sphinxbase and pocketsphinx library. As far as I can see they look the same as the example in http://www.moreiscode.com/setting-up-pocketsphinx-in-ios/

    To do my xcode build I must point to both the sphinxbase and pocketsphinx libs and have other linker flags for both. Above website says I should just only need sphinxbase?

    What can I send you to help me solve this problem?

    I do all my apple development using MacinClould. This works great except that I must send an Ad Hoc build back to my windows pc to do actual voice recognition testing on Iphone.

     
    • Nickolay V. Shmyrev

      There is no need to dig vocalkit grave, you can just work with openears. Just set the timer when you start recognition and when timer expires stop it.

      See for details https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/

       
      • Nickolay V. Shmyrev

        You can also modify openears source code to support this timed recognition just like on Android. Unfortunately our APIs across platforms are not really in sync, but we hope we'll get one day to the more reasonable point.

         
        • mike pfaff

          mike pfaff - 2015-11-18

          I was told there is no stop recognition in openears, that's why I started down this path. Can you point me to the openears source code? I did not know it was avaialable

           
          • Nickolay V. Shmyrev

            Well, there is no exact feature you need but there are some activity which is close. You can check stuckEndingTimer in the sources.

            Sources are downloadable with a big green button on the openears website:

            http://cdn1.politepix.com/wp-content/uploads/OpenEarsDistribution.tar.bz2

             
  • mike pfaff

    mike pfaff - 2015-11-20

    Thank you for your help. I found stuckEndingTimer in OEContinuousModel.m but I don’t understand what I need to do to recognizer.stop(); as I do in Android demo. I wonder if I need to issue ps_end_utt? I found the following in the code
    - (void) endUtterance {
    ps_end_utt(self.pocketSphinxDecoder);

    I setup the NSTimer in my Viewcontroller just before

     [[OEPocketsphinxController sharedInstance] resumeRecognition];
    

    . When the timer went off I tried

    OEContinuousModel *ContinuousModel = [[OEContinuousModel alloc] init];
    [ContinuousModel endUtterance];

    Which gave me EXC_BAD_ACCESS code-2

    I would appreciate any direction you can give me.

     
  • mike pfaff

    mike pfaff - 2015-11-21

    I tried NSError *error = [[OEPocketsphinxController sharedInstance] stopListening]; after 5 seconds which did not crash but did throw away the recognition I was waiting for and stopped all recognition after that.

    So my question is which will be easier, making changes to Openears source or solving my problem with Vocal Kit? Vocal Kit does have the added advantage of allowing me to use the same .dic and .lm files for both Android and Iphone. If I change the Openears source, I assume I have to rebuild the entire framework? If so won’t I have to build the sphinxbase and pocketsphix libraries? It would be nice to have the recogizer.stop feature in Openears, I would think other users would want it. Can you offer any help here?

    By the way the problem is easy to replicate. If I test my Iphone app inside it gives me 2 second response. If I turn on the TV , the recognizer hears that and stays open. If I mute TV it then recognizes the words I said.

     
  • mike pfaff

    mike pfaff - 2015-11-28

    VocalKit lives. Found xcode problem/bug, now getting 3.5 second recognition time. Openears was staying open for up to a minute due to background noise on tennis court.

     

Log in to post a comment.