How to deallocate OpenEars singleton (2.0) ?

Home Forums OpenEars How to deallocate OpenEars singleton (2.0) ?

Tagged: ,

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

  • Author
    Posts
  • #1026668
    pizigi
    Participant

    Hi,

    My application has a need to completely shutdown and deallocate OpenEars during runtime. I would like to call stopListening(), and then proceed to fully deallocate all OpenEars resources held by its Singleton.

    In OEPocketSphinxController.h I found this:

    /**This needs to be called with the value TRUE before setting properties of OEPocketsphinxController for the first time in a session, and again before using OEPocketsphinxController in case it has been called with the value FALSE.*/
    - (BOOL)setActive:(BOOL)active error:(NSError **)outError;
    - (void)dealloc __attribute__((unavailable("Do not dealloc OEPocketsphinxController directly – calling [[OEPocketsphinxController sharedInstance] setActive:FALSE error:nil] will allow memory to be released when needed.")));
    
    

    From those comments, it would seem calling setActive:FALSE would do the trick.
    However that doesn’t seem to have any effect.
    I checked the source code, and found this in the setActive implementation:

    - (BOOL)setActive:(BOOL)active error:(NSError **)outError { 
        
        if(active) {
            outError = nil;
            return TRUE;
        } else {
            outError = nil;        
            return TRUE;        
        }
    }
    

    That code doesn’t seem to be doing anything at all, it’s just a stub that returns TRUE.

    How can I cause the singleton to fully destroy itself and deallocate without having to kill my app?

    #1026669
    Halle Winkler
    Politepix

    Sorry, the fact that you don’t memory manage it is pretty much the main idea – you also don’t deallocate your app delegate or AVAudioSession. It was switched to a singleton because it was too error-prone for many developers to have the responsibility to not create multiple instances, i.e. setting up and tearing down led to lots of support cases because unlike many kinds of objects that aren’t based on singular physical resources like a mono microphone, you can’t have more than one input stream for OEPocketsphinxController and that was difficult for some to work with.

    setActive: is the way that it is because on its first call it provides the opportunity to initialize with any passed-in settings if that hasn’t happened before, and on its second call any future cleanup can be added without an API change. Otherwise the setup would occur at the time of making the first call to OEPocketsphinxController and could result in the first call not taking effect depending on what the initialization state was. In this respect it is architecturally similar to AVAudioSession. Currently the TRUE call can cause things to happen and the FALSE call doesn’t, but that is an implementation detail, has been different at times in the past, and is constructed that way specifically in order to allow it to painlessly change in the future without breaking anything.

    OEPocketsphinxController shouldn’t be holding on to memory in a stopped state since all cleanup is currently done when stopListening is called, so it shouldn’t affect your app unless you’ve created a strong link with some other part architecturally.

    Do you want to discuss what the reason for wanting to deallocate it is? Maybe I can help, or maybe you are encountering an issue that should be looked at on my end.

    #1026672
    pizigi
    Participant

    Thanks for the quick reply Halle.

    OK, so I think I understand the reasoning behind setActive. It’s just there to ensure sharedInstance has been fully initialized before we carry on with our code.

    About the problem at hand, the reason I need to deallocate it is because of a conflict with other libraries my application is currently using (Unity 3D in my case).
    I understand you cannot provide support for such kinds of use cases, so I isolated the problem to try to turn it into something that could be inside the scope of the support we can get.
    If I was able to completely destroy the Singleton and reinitialize OpenEars from scratch, I’m sure I would be able to solve the issue I’m having.

    Anyway, let me explain why I need to do this, as it may very well be a bug in OpenEars. I hope the following information will be helpful.

    Here we go:
    Whenever I plug in headphones during runtime, OpenEars will call StopListening by itself, and apparently try to restart the listening process after the Audio Route changes. However, after StopListening is called, it fails to restart the listening process and OEPocketsphinxController is put into some kind of invalid locked state. That lock is never released, and it doesn’t allow me to call StopListening to shut it off, or StartListening either. It’s basically just dead.
    Unplugging the headphones has no effect, OpenEars no longer responds to it.

    Here’s are the logs I get as soon as I plug in the headphones:

    2015-08-30 00:43:43.263 mathcommand[12363:3873953] Audio route has changed for the following reason:
    2015-08-30 00:43:43.263 mathcommand[12363:3873953] A new device is available
    2015-08-30 00:43:43.263 mathcommand[12363:3873953] The audio input is available
    2015-08-30 00:43:43.265 mathcommand[12363:3873953] This is a case for performing a route change. Before the route change, the current route was HeadphonesMicrophoneWired. Performing route change.
    2015-08-30 00:43:43.266 mathcommand[12363:3873953] Audio route change. The new audio route is HeadphonesMicrophoneWired
    2015-08-30 00:43:43.267 mathcommand[12363:3873953] Stopping listening.
    2015-08-30 00:43:43.267 mathcommand[12363:3874187] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-08-30 00:43:44.658 mathcommand[12363:3873953] 00:43:44.657 ERROR:     [0x3a5069dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-08-30 00:43:44.659 mathcommand[12363:3873953] Error: couldn't set session inactive.: '!act'
    2015-08-30 00:43:44.669 mathcommand[12363:3873953] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-08-30 00:43:44.670 mathcommand[12363:3873953] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-08-30 00:43:44.721 mathcommand[12363:3873953] Attempting to stop an unstopped utterance so listening can stop.
    2015-08-30 00:43:44.752 mathcommand[12363:3873953] No longer listening.
    2015-08-30 00:43:44.754 mathcommand[12363:3873953] Pocketsphinx has stopped listening.
    2015-08-30 00:43:44.754 mathcommand[12363:3874198] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-08-30 00:43:44.761 mathcommand[12363:3873953] Audio route has changed for the following reason:
    2015-08-30 00:43:44.762 mathcommand[12363:3873953] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-08-30 00:43:44.765 mathcommand[12363:3873953] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Headphones---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x19305160, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x19309610, type = MicrophoneWired; name = Headset Microphone; UID = Wired Microphone; selectedDataSource = (null)>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x193772f0, type = Headphones; name = Headphones; UID = Wired Headphones; selectedDataSource = (null)>"
    )>.

    After this, whenever I try to call StartListening, I get this:

    2015-08-30 00:43:47.849 mathcommand[12363:3874198] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:

    And if I try to call StopListening, I get this:
    2015-08-30 01:17:17.484 mathcommand[12378:3879295] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.

    As you can see, OEPocketsphinxController is clearly in a locked state. Neither StopListening nor StartListening will work anymore.
    I can’t find a way to unlock it. So that’s the reason I want to destroy the Singleton.

    I hope these logs can be useful.

    #1026676
    Halle Winkler
    Politepix

    Hi,

    OK, I can attempt to see if I can help with this if we can isolate the cause a bit more. I can’t give any assistance with memory managing the singleton – it will create many side-effects and divergences from the normal behavior of the library since the library is developed and tested on the assumption that its memory management is as it is, and I’ll have the problem of supporting anyone else who goes that route as a result of reading this discussion, meaning that I will be heavily supporting Unity and in a uniquely architecturally weird implementation, so I have to decline to pursue that request further, sorry. It is also not guaranteed to help, since the issue above is with the audio session, and that would persist through any changes in OEPocketsphinxController because the audio session is a singleton from Apple.

    What is happening there in your logging as far as I can see is that some part of your Unity implementation is creating a race condition to the audio session or another aspect of the audio environment – perhaps two things are listening for audio changes and reacting to them, one of them being OpenEars and the other being part of Unity. There’s no info yet in your issue report about what else is happening with audio in your app. So the first step to trying to isolate the behavior into something that I might be able to help with is to find out what part of the rest of your app is colliding with OEPocketsphinxController’s management of its audio state –– see if there is anything you can turn off which changes the behavior. The other thing that is quite important is turning on verbosePocketsphinx so that your logging is complete, and showing your entire app session’s OpenEars logs rather than editing it down, because there is no way to know at what stage in the logging something significant to the issue you are seeing will happen.

    #1026677
    pizigi
    Participant

    Yes, I can understand that. If destroying the singleton is not officially supported, I won’t insist on asking about it any further.

    By the way, I must mention that OpenEars works well with Unity as long as I keep it listening. Once StopListening is called though, things can get quirky – and that’s why I avoid calling it during my application’s lifetime. However, plugging the headphones is causing StopListening to be called without my consent, so I’m trying to find a way to deal with it.

    About the audio usage in the app, it continuously plays music and sound effects – nothing out of the ordinary at all.
    It could be that Unity is also reacting to the plugging of the headphones, causing some race condition on the audio session.

    About my logs, I’m sorry I totally forgot to turn on verbosePocketsphinx.
    I’ve now turned it on, here are the detailed logs when I plug in the headphones:

    2015-08-30 18:47:12.624 mathcommand[517:53825] Audio route has changed for the following reason:
    2015-08-30 18:47:12.626 mathcommand[517:53825] A new device is available
    2015-08-30 18:47:12.627 mathcommand[517:53825] The audio input is available
    2015-08-30 18:47:12.627 mathcommand[517:54064] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-08-30 18:47:12.629 mathcommand[517:53825] This is a case for performing a route change. Before the route change, the current route was HeadphonesMicrophoneWired. Performing route change.
    2015-08-30 18:47:12.636 mathcommand[517:53825] Audio route change. The new audio route is HeadphonesMicrophoneWired
    2015-08-30 18:47:12.636 mathcommand[517:53825] Stopping listening.
    2015-08-30 18:47:14.054 mathcommand[517:53825] 18:47:14.053 ERROR:     [0x359209dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-08-30 18:47:14.055 mathcommand[517:53825] Error: couldn't set session inactive.: '!act'
    2015-08-30 18:47:14.064 mathcommand[517:53825] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-08-30 18:47:14.065 mathcommand[517:53825] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-08-30 18:47:14.116 mathcommand[517:53825] Attempting to stop an unstopped utterance so listening can stop.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 59.69 -4.47 -10.29 -7.20 -17.60  2.49 -8.36 -10.72  1.61  1.11 -9.08  3.88  2.02 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 59.87 -4.03 -10.01 -6.71 -17.52  2.57 -8.13 -10.16  1.73  1.15 -8.93  3.75  1.99 >
    INFO: ngram_search_fwdtree.c(1553):      159 words recognized (8/fr)
    INFO: ngram_search_fwdtree.c(1555):     3443 senones evaluated (181/fr)
    INFO: ngram_search_fwdtree.c(1559):     1586 channels searched (83/fr), 270 1st, 762 last
    INFO: ngram_search_fwdtree.c(1562):      264 words for which last channels evaluated (13/fr)
    INFO: ngram_search_fwdtree.c(1564):      110 candidate words for entering last phone (5/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 1.10 CPU 5.797 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 3.63 wall 19.090 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 3 words
    INFO: ngram_search_fwdflat.c(948):      123 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):      534 senones evaluated (28/fr)
    INFO: ngram_search_fwdflat.c(952):      153 channels searched (8/fr)
    INFO: ngram_search_fwdflat.c(954):      153 words searched (8/fr)
    INFO: ngram_search_fwdflat.c(957):       54 word transitions (2/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.020 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.024 xRT
    INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 6.36 CPU 1.545 xRT
    INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 17.69 wall 4.293 xRT
    INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.15 CPU 0.037 xRT
    INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.21 wall 0.050 xRT
    INFO: ngram_search.c(307): TOTAL bestpath 0.04 CPU 0.011 xRT
    INFO: ngram_search.c(310): TOTAL bestpath 0.05 wall 0.012 xRT
    2015-08-30 18:47:14.134 mathcommand[517:53825] No longer listening.
    2015-08-30 18:47:14.136 mathcommand[517:53825] Pocketsphinx has stopped listening.
    2015-08-30 18:47:14.137 mathcommand[517:54064] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-08-30 18:47:14.145 mathcommand[517:53825] Audio route has changed for the following reason:
    2015-08-30 18:47:14.146 mathcommand[517:53825] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-08-30 18:47:14.149 mathcommand[517:53825] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Headphones---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1632ea90, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x163b2a20, type = MicrophoneWired; name = Headset Microphone; UID = Wired Microphone; selectedDataSource = (null)>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x16393a10, type = Headphones; name = Headphones; UID = Wired Headphones; selectedDataSource = (null)>"
    )>.

    It doesn’t look like it prints much more information than what we already had before, though.
    Here’s a full log of my OpenEars initialization, at application startup:

    2015-08-30 19:13:07.257 mathcommand[542:57739] Creating shared instance of OEPocketsphinxController
    2015-08-30 19:13:07.260 mathcommand[542:57739] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    [PocketSphinx] Recognition Setup Completed
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-08-30 19:13:07.265 mathcommand[542:57739] User gave mic permission for this app.
    2015-08-30 19:13:07.266 mathcommand[542:57739] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-08-30 19:13:07.267 mathcommand[542:57749] Starting listening.
    2015-08-30 19:13:07.267 mathcommand[542:57749] about to set up audio session
    2015-08-30 19:13:07.269 mathcommand[542:57739] Successfully started listening session from startListeningWithLanguageModelAtPath:
    2015-08-30 19:13:07.817 mathcommand[542:57749] Creating audio session with default settings.
    2015-08-30 19:13:07.819 mathcommand[542:57601] Audio route has changed for the following reason:
    2015-08-30 19:13:07.821 mathcommand[542:57601] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-08-30 19:13:07.855 mathcommand[542:57601] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x18344430, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x16fd5270, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    2015-08-30 19:13:07.863 mathcommand[542:57601] Audio route has changed for the following reason:
    2015-08-30 19:13:07.863 mathcommand[542:57601] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-08-30 19:13:07.865 mathcommand[542:57601] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x182f9250, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x1828cca0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x182ade70, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    2015-08-30 19:13:07.876 mathcommand[542:57749] done starting audio unit
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpath yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0		2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -bestpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase				
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -mllr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/47CE4D3C-BB6B-4309-B0BA-A800D6160E30/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-08-30 19:13:08.014 mathcommand[542:57749] There was no previous CMN value in the plist so we are using the fresh CMN value 42.000000.
    2015-08-30 19:13:08.015 mathcommand[542:57749] Listening.
    2015-08-30 19:13:08.016 mathcommand[542:57749] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-08-30 19:13:08.016 mathcommand[542:57749] Recognition loop has started
    2015-08-30 19:13:08.018 mathcommand[542:57601] Pocketsphinx is now listening.

    After this initialization sequence is complete, OpenEars is up and running and working just fine.

    Lastly, I didn’t mention that I have a way to deal with most AudioSession woes by asking Unity to reset the audio system. That’s what I do if I ever need to call StopListening, and it basically reconfigures the AVAudioSession to a clean state.
    So if I call StopListening() and reset the audio system in the pocketsphinxDidStopListening() callback, I’m usually fine.
    However this solution is not working at the moment because of the locked state OEPocketSphinxController finds itself in after the user plugs in the headphones.

    It would be great if I could get OEPocketSphinx to unlock itself somehow.

    #1026678
    Halle Winkler
    Politepix

    Thanks for turning verbosePocketsphinx on, but do I need to see the complete logs from the start of the app to everything that is printed out in a failed stopListening. Please make sure not to show any more logs which are excerpted and refer to a single event in the session:

    The other thing that is quite important is turning on verbosePocketsphinx so that your logging is complete, and showing your entire app session’s OpenEars logs rather than editing it down, because there is no way to know at what stage in the logging something significant to the issue you are seeing will happen.

    By the way, I must mention that OpenEars works well with Unity as long as I keep it listening. Once StopListening is called though, things can get quirky – and that’s why I avoid calling it during my application’s lifetime. However, plugging the headphones is causing StopListening to be called without my consent, so I’m trying to find a way to deal with it.

    OK, I’m glad to hear that it is largely working and issues are clustering around a specific behavior that is possible to troubleshoot. The issue here isn’t that route changes call stopListening on their own (this is very important behavior: there are many things that can happen in the user’s app session that you don’t control that requires stopping and restarting listening, such as an incoming call, a media server reset, a route change with route characteristics that would cause the audio unit callback to fail, etc) but that stopListening doesn’t work and you have a workaround for it which requires twice as many calls to the audio session at a time when OpenEars is trying to manage its own session. So the part to focus on troubleshooting, I’d say, is making it so you don’t need to use your workaround.

    When I asked what Unity was doing with the audio, I meant that on your side of things you should do a bit of research on what kinds of audio settings Unity is trying to enforce in your app, so we can get to some hypotheses about why it prevents stopListening from working normally. I can’t do that because I’m not a Unity user or developer.

    #1026695
    pizigi
    Participant

    I agree the problem must be in StopListening(), so from now on I’ll be focusing on that.
    I’ve removed my workaround, and added an AVAudioSessionRouteChangeNotification observer so I can dump the whole AVAudioSession settings whenever a route change is detected.

    First, I ran the application without OpenEars enabled, which means Unity is the only one managing the audio session.
    After app startup, I plugged the headphones and then unplugged it a few seconds later.
    Here are the logs with the AVAudioSession settings dumps:

    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 24000, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 13:41:35.739 mathcommand[1553:476906] 13:41:35.738 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:41:35.739 mathcommand[1553:476906] 13:41:35.739 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:41:35.745 mathcommand[1553:476906] Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.042667
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013500
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 24000.000000
    - recordPermission: 1735552628
    - sampleRate: 24000.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    
    2015-09-03 13:41:46.055 mathcommand[1553:476906] routeChangeReason : AVAudioSessionRouteChangeReasonNewDeviceAvailable
    2015-09-03 13:41:46.063 mathcommand[1553:476906] 13:41:46.063 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:41:46.065 mathcommand[1553:476906] 13:41:46.065 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:41:46.067 mathcommand[1553:476906] Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    Chartboost: didCacheRewardedVideo: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 13:42:34.820 mathcommand[1553:476906] routeChangeReason : AVAudioSessionRouteChangeReasonOldDeviceUnavailable
    2015-09-03 13:42:34.828 mathcommand[1553:476906] 13:42:34.828 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:42:34.829 mathcommand[1553:476906] 13:42:34.829 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 13:42:34.831 mathcommand[1553:476906] Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0

    From these logs, I noticed these key settings:
    category: AVAudioSessionCategoryAmbient
    mode: AVAudioSessionModeDefault
    sampleRate: 24000 (but changes to 44100 when plugging/unplugging the headphones)
    Only the sample rate was changed during the route change.

    So this was with no OpenEars.
    Next is the full log with OpenEars enabled.
    Note that I start the application, wait for OpenEars to fully initialize (and even recognize a few utterances), and then I plug the headphones and unplug it a few seconds later.
    Here what is looks like:

    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 24000, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:12.938 mathcommand[1591:483805] 14:21:12.937 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:12.938 mathcommand[1591:483805] 14:21:12.938 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:12.943 mathcommand[1591:483805] 
    Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.042667
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013500
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 24000.000000
    - recordPermission: 1735552628
    - sampleRate: 24000.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 14:21:12.943 mathcommand[1591:483805] [PocketSphinx] Startup
    2015-09-03 14:21:12.946 mathcommand[1591:483805] Starting OpenEars logging for OpenEars version 2.041 on 32-bit device (or build): iPhone running iOS version: 8.400000
    2015-09-03 14:21:12.947 mathcommand[1591:483805] [PocketSphinx] SetupLanguage: English
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 24000, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:13.772 mathcommand[1591:483805] [PocketSphinx] Start Recording
    2015-09-03 14:21:13.772 mathcommand[1591:483955] Creating shared instance of OEPocketsphinxController
    2015-09-03 14:21:13.773 mathcommand[1591:483955] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 14:21:13.774 mathcommand[1591:483955] User gave mic permission for this app.
    2015-09-03 14:21:13.775 mathcommand[1591:483955] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-09-03 14:21:13.775 mathcommand[1591:483955] Successfully started listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 14:21:13.775 mathcommand[1591:483966] Starting listening.
    2015-09-03 14:21:13.775 mathcommand[1591:483966] about to set up audio session
    [PocketSphinx] Recognition Setup Completed
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:14.287 mathcommand[1591:483966] Creating audio session with default settings.
    2015-09-03 14:21:14.382 mathcommand[1591:483805] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.128000
    - inputLatency: 0.012542
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013667
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 24000.000000
    - recordPermission: 1735552628
    - sampleRate: 24000.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 14:21:14.390 mathcommand[1591:483966] done starting audio unit
    2015-09-03 14:21:14.396 mathcommand[1591:483805] Audio route has changed for the following reason:
    2015-09-03 14:21:14.398 mathcommand[1591:483805] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 14:21:14.400 mathcommand[1591:483805] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1726f200, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x172c23f0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpa2015-09-03 14:21:14.417 mathcommand[1591:483805] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.128000
    - inputLatency: 0.012542
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013667
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 24000.000000
    - recordPermission: 1735552628
    - sampleRate: 24000.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    th yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0	2015-09-03 14:21:14.422 mathcommand[1591:483805] Audio route has changed for the following reason:
    	2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -bestpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    2015-09-03 14:21:14.423 mathcommand[1591:483805] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E82015-09-03 14:21:14.425 mathcommand[1591:483805] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1726ad10, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x1724a260, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x172743b0, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    6-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase				
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -mllr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/mdef
    -> applicationWillResignActive()
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/A57FE0BE-40E1-4E86-9BBE-2915F35097FE/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-09-03 14:21:14.713 mathcommand[1591:483966] There was no previous CMN value in the plist so we are using the fresh CMN value 42.000000.
    2015-09-03 14:21:14.713 mathcommand[1591:483966] Listening.
    2015-09-03 14:21:14.713 mathcommand[1591:483805] Pocketsphinx is now listening.
    2015-09-03 14:21:14.714 mathcommand[1591:483966] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-09-03 14:21:14.714 mathcommand[1591:483805] Pocketsphinx is starting up.
    2015-09-03 14:21:14.715 mathcommand[1591:483966] Recognition loop has started
    2015-09-03 14:21:14.888 mathcommand[1591:483966] Speech detected...
    2015-09-03 14:21:14.889 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:15.122 mathcommand[1591:483966] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 42.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 34.12 -0.58 -8.43 -3.22 -2.60 -1.60  3.53 -1.01 -4.43  1.96 -4.67 -0.28  2.27 >
    2015-09-03 14:21:15.123 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdtree.c(1553):      167 words recognized (6/fr)
    INFO: ngram_search_fwdtree.c(1555):     2432 senones evaluated (87/fr)
    INFO: ngram_search_fwdtree.c(1559):      893 channels searched (31/fr), 432 1st, 296 last
    INFO: ngram_search_fwdtree.c(1562):      296 words for which last channels evaluated (10/fr)
    INFO: ngram_search_fwdtree.c(1564):        4 candidate words for entering last phone (0/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.04 CPU 0.152 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.26 wall 0.935 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 2 words
    INFO: ngram_search_fwdflat.c(948):      167 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):      513 senones evaluated (18/fr)
    INFO: ngram_search_fwdflat.c(952):      219 channels searched (7/fr)
    INFO: ngram_search_fwdflat.c(954):      219 words searched (7/fr)
    INFO: ngram_search_fwdflat.c(957):       53 word transitions (1/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.003 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.010 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.19
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 95 nodes, 226 links
    INFO: ps_lattice.c(1380): Bestpath score: -44159
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:19:26) = -2749078
    INFO: ps_lattice.c(1441): Joint P(O,S) = -2765097 P(S|O) = -16019
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.001 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.002 xRT
    2015-09-03 14:21:15.127 mathcommand[1591:483966] Pocketsphinx heard "" with a score of (-16019) and an utterance ID of 0.
    2015-09-03 14:21:15.127 mathcommand[1591:483805] The received hypothesis is  with a score of -16019 and an ID of 0
    2015-09-03 14:21:15.128 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -65247
      },
      {
        "Hypothesis" : "",
        "Score" : -810302
      },
      {
        "Hypothesis" : "",
        "Score" : -810525
      },
      {
        "Hypothesis" : "",
        "Score" : -810549
      },
      {
        "Hypothesis" : "",
        "Score" : -810573
      }
    ]
    2015-09-03 14:21:15.128 mathcommand[1591:483805] hypothesisArray is ,,,,
    -> applicationDidBecomeActive()
    [PocketSphinx] Start Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    LoadingScreen: OnStartListening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Avg mic level: 0.009702918
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:17.312 mathcommand[1591:483955] Speech detected...
    2015-09-03 14:21:17.316 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:17.552 mathcommand[1591:483966] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 34.12 -0.58 -8.43 -3.22 -2.60 -1.60  3.53 -1.01 -4.43  1.96 -4.67 -0.28  2.27 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 37.30 -7.32 -9.74 -4.97 -2.30  1.95  1.13  4.18 -5.96 -1.30 -6.07 -0.42  0.44 >
    INFO: ngram_search_fwdtree.c(1553):      263 words recognized (11/fr)
    INFO: ngram_search_fwdtree.c(1555):     5829 senones evaluated (243/fr)
    INFO: ngram_search_fwdtree.c(1559):     3059 channels searched (127/fr), 360 1st, 1527 last
    INFO: ngram_search_fwdtree.c(1562):      370 words for which last channels evaluated (15/fr)
    INFO: ngram_search_fwdtree.c(1564):      170 candidate words for entering last phone (7/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.35 CPU 1.475 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 2.43 wall 10.112 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 7 words
    INFO: ngram_search_fwdflat.c(948):      198 words recognized (8/fr)
    INFO: ngram_search_fwdflat.c(950):     2460 senones evaluated (102/fr)
    INFO: ngram_search_fwdflat.c(952):     1289 channels searched (53/fr)
    INFO: ngram_search_fwdflat.c(954):      303 words searched (12/fr)
    INFO: ngram_search_fwdflat.c(957):      161 word transitions (6/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.012 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.014 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.20
    INFO: ngram_search.c(1306): Eliminated 5 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 56 nodes, 221 links
    INFO: ps_lattice.c(1380): Bestpath score: -4158
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:20:22) = 1758229
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1671595 P(S|O) = -86634
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.001 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.002 xRT
    2015-09-03 14:21:17.559 mathcommand[1591:483966] Pocketsphinx heard "E" with a score of (-86634) and an utterance ID of 1.
    2015-09-03 14:21:17.566 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    2015-09-03 14:21:17.566 mathcommand[1591:483805] The received hypothesis is E with a score of -86634 and an ID of 1
    2015-09-03 14:21:17.567 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -66989
      },
      {
        "Hypothesis" : "",
        "Score" : -811778
      },
      {
        "Hypothesis" : "",
        "Score" : -811970
      },
      {
        "Hypothesis" : "",
        "Score" : -812047
      },
      {
        "Hypothesis" : "",
        "Score" : -812108
      }
    ]
    2015-09-03 14:21:17.567 mathcommand[1591:483805] hypothesisArray is ,,,,
    2015-09-03 14:21:17.827 mathcommand[1591:483966] Speech detected...
    2015-09-03 14:21:17.833 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:18.065 mathcommand[1591:483955] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 37.30 -7.32 -9.74 -4.97 -2.30  1.95  1.13  4.18 -5.96 -1.30 -6.07 -0.42  0.44 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 41.64 -6.46 -9.00 -2.98 -3.14  0.15 -2.56 -0.20 -7.90 -0.61 -4.38  1.92 -1.89 >
    INFO: ngram_search_fwdtree.c(1553):      325 words recognized (13/fr)
    INFO: ngram_search_fwdtree.c(1555):     6380 senones evaluated (255/fr)
    INFO: ngram_search_fwdtree.c(1559):     3350 channels searched (134/fr), 378 1st, 1665 last
    INFO: ngram_search_fwdtree.c(1562):      401 words for which last channels evaluated (16/fr)
    INFO: ngram_search_fwdtree.c(1564):      218 candidate words for entering last phone (8/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.23 CPU 0.901 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.51 wall 2.028 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 7 words
    INFO: ngram_search_fwdflat.c(948):      230 words recognized (9/fr)
    INFO: ngram_search_fwdflat.c(950):     2251 senones evaluated (90/fr)
    INFO: ngram_search_fwdflat.c(952):     1206 channels searched (48/fr)
    INFO: ngram_search_fwdflat.c(954):      318 words searched (12/fr)
    INFO: ngram_search_fwdflat.c(957):      168 word transitions (6/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.000 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.011 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.21
    INFO: ngram_search.c(1306): Eliminated 1 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 48 nodes, 312 links
    INFO: ps_lattice.c(1380): Bestpath score: -4357
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:21:23) = 1737231
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1654545 P(S|O) = -82686
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.002 xRT
    2015-09-03 14:21:18.076 mathcommand[1591:483955] Pocketsphinx heard "A" with a score of (-82686) and an utterance ID of 2.
    2015-09-03 14:21:18.213 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    2015-09-03 14:21:18.214 mathcommand[1591:483805] The received hypothesis is A with a score of -82686 and an ID of 2
    2015-09-03 14:21:18.214 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -67284
      },
      {
        "Hypothesis" : "",
        "Score" : -812128
      },
      {
        "Hypothesis" : "",
        "Score" : -812255
      },
      {
        "Hypothesis" : "",
        "Score" : -812256
      },
      {
        "Hypothesis" : "",
        "Score" : -812276
      }
    ]
    2015-09-03 14:21:18.214 mathcommand[1591:483805] hypothesisArray is ,,,,
    Chartboost: didCacheRewardedVideo: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:19.094 mathcommand[1591:483866] Speech detected...
    2015-09-03 14:21:19.095 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:19.342 mathcommand[1591:483964] End of speech detected...
    2015-09-03 14:21:19.343 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 41.64 -6.46 -9.00 -2.98 -3.14  0.15 -2.56 -0.20 -7.90 -0.61 -4.38  1.92 -1.89 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 41.50 -2.73 -9.19 -1.18 -1.44  0.56 -1.91 -0.37 -8.52 -0.63 -2.23  2.94 -2.73 >
    INFO: ngram_search_fwdtree.c(1553):      484 words recognized (15/fr)
    INFO: ngram_search_fwdtree.c(1555):     8844 senones evaluated (276/fr)
    INFO: ngram_search_fwdtree.c(1559):     4659 channels searched (145/fr), 504 1st, 2338 last
    INFO: ngram_search_fwdtree.c(1562):      545 words for which last channels evaluated (17/fr)
    INFO: ngram_search_fwdtree.c(1564):      293 candidate words for entering last phone (9/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.30 CPU 0.953 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 1.27 wall 3.958 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 10 words
    INFO: ngram_search_fwdflat.c(948):      341 words recognized (11/fr)
    INFO: ngram_search_fwdflat.c(950):     5291 senones evaluated (165/fr)
    INFO: ngram_search_fwdflat.c(952):     3241 channels searched (101/fr)
    INFO: ngram_search_fwdflat.c(954):      507 words searched (15/fr)
    INFO: ngram_search_fwdflat.c(957):      303 word transitions (9/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.01 CPU 0.031 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.030 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.28
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 57 nodes, 324 links
    INFO: ps_lattice.c(1380): Bestpath score: -4770
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:28:30) = 1717224
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1636113 P(S|O) = -81111
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.006 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.004 xRT
    2015-09-03 14:21:19.356 mathcommand[1591:483964] Pocketsphinx heard "A" with a score of (-81111) and an utterance ID of 3.
    2015-09-03 14:21:19.357 mathcommand[1591:483805] The received hypothesis is A with a score of -81111 and an ID of 3
    2015-09-03 14:21:19.358 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -26007
      },
      {
        "Hypothesis" : "OH A",
        "Score" : -26529
      },
      {
        "Hypothesis" : "O A",
        "Score" : -26529
      },
      {
        "Hypothesis" : "I A",
        "Score" : -26546
      },
      {
        "Hypothesis" : "A A",
        "Score" : -26575
      }
    ]
    2015-09-03 14:21:19.358 mathcommand[1591:483805] hypothesisArray is A,OH A,O A,I A,A A
    Showing screen: GameOpening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    [AudioController] Playing music: OpeningMusic (UnityEngine.GameObject)
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Refresh Anchors
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:21.420 mathcommand[1591:483965] Speech detected...
    2015-09-03 14:21:21.435 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:21.663 mathcommand[1591:483964] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 41.50 -2.73 -9.19 -1.18 -1.44  0.56 -1.91 -0.37 -8.52 -0.63 -2.23  2.94 -2.73 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 42.67 -0.19 -7.35 -1.26 -3.40 -2.54 -2.14 -2.70 -6.86 -2.12 -2.61  0.15 -2.16 >
    INFO: ngram_search_fwdtree.c(1553):      572 words recognized (16/fr)
    INFO: ngram_search_fwdtree.c(1555):    10938 senones evaluated (304/fr)
    INFO: ngram_search_fwdtree.c(1559):     6592 channels searched (183/fr), 576 1st, 4451 last
    INFO: ngram_search_fwdtree.c(1562):      674 words for which last channels evaluated (18/fr)
    INFO: ngram_search_fwdtree.c(1564):      215 candidate words for entering last phone (5/fr)
    2015-09-03 14:21:21.673 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdtree.c(1567): fwdtree 1.24 CPU 3.435 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 2.31 wall 6.431 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 14 words
    INFO: ngram_search_fwdflat.c(948):      505 words recognized (14/fr)
    INFO: ngram_search_fwdflat.c(950):     7370 senones evaluated (205/fr)
    INFO: ngram_search_fwdflat.c(952):     5420 channels searched (150/fr)
    INFO: ngram_search_fwdflat.c(954):      707 words searched (19/fr)
    INFO: ngram_search_fwdflat.c(957):      455 word transitions (12/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.04 CPU 0.115 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.03 wall 0.070 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.32
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 89 nodes, 581 links
    INFO: ps_lattice.c(1380): Bestpath score: -5721
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:32:34) = 1653457
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1584196 P(S|O) = -69261
    INFO: ngram_search.c(899): bestpath 0.01 CPU 0.025 xRT
    INFO: ngram_search.c(902): bestpath 0.01 wall 0.017 xRT
    2015-09-03 14:21:21.714 mathcommand[1591:483964] Pocketsphinx heard "AND" with a score of (-69261) and an utterance ID of 4.
    2015-09-03 14:21:21.718 mathcommand[1591:483805] The received hypothesis is AND with a score of -69261 and an ID of 4
    2015-09-03 14:21:21.720 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "AND",
        "Score" : -26809
      },
      {
        "Hypothesis" : "AND",
        "Score" : -26841
      },
      {
        "Hypothesis" : "OH",
        "Score" : -26900
      },
      {
        "Hypothesis" : "O",
        "Score" : -26900
      },
      {
        "Hypothesis" : "A",
        "Score" : -26916
      }
    ]
    2015-09-03 14:21:21.722 mathcommand[1591:483805] hypothesisArray is AND,AND,OH,O,A
    Chartboost: didCacheInterstitial: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:22.550 mathcommand[1591:483955] Speech detected...
    2015-09-03 14:21:22.553 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:23.577 mathcommand[1591:483865] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 42.67 -0.19 -7.35 -1.26 -3.40 -2.54 -2.14 -2.70 -6.86 -2.12 -2.61  0.15 -2.16 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 47.85  1.17 -7.23 -2.44 -13.78 -4.70 -7.25 -8.91 -3.97 -3.01 -0.88 -3.18  2.08 >
    INFO: ngram_search_fwdtree.c(1553):     1609 words recognized (13/fr)
    INFO: ngram_search_fwdtree.c(1555):    35766 senones evaluated (296/fr)
    INFO: ngram_search_fwdtree.c(1559):    18413 channels searched (152/fr), 2106 1st, 7690 last
    INFO: ngram_search_fwdtree.c(1562):     2068 words for which last channels evaluated (17/fr)
    INFO: ngram_search_fwdtree.c(1564):     1172 candidate words for entering last phone (9/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 1.44 CPU 1.186 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 1.86 wall 1.538 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 15 words
    2015-09-03 14:21:23.591 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdflat.c(948):     1296 words recognized (11/fr)
    INFO: ngram_search_fwdflat.c(950):    24934 senones evaluated (206/fr)
    INFO: ngram_search_fwdflat.c(952):    15674 channels searched (129/fr)
    INFO: ngram_search_fwdflat.c(954):     2297 words searched (18/fr)
    INFO: ngram_search_fwdflat.c(957):     1053 word transitions (8/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.05 CPU 0.038 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.03 wall 0.026 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.117
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 513 nodes, 4124 links
    INFO: ps_lattice.c(1380): Bestpath score: -18550
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:117:119) = 1060502
    INFO: ps_lattice.c(1441): Joint P(O,S) = 921618 P(S|O) = -138884
    INFO: ngram_search.c(899): bestpath 0.01 CPU 0.010 xRT
    INFO: ngram_search.c(902): bestpath 0.01 wall 0.008 xRT
    2015-09-03 14:21:23.621 mathcommand[1591:483865] Pocketsphinx heard "AH" with a score of (-138884) and an utterance ID of 5.
    2015-09-03 14:21:23.634 mathcommand[1591:483805] The received hypothesis is AH with a score of -138884 and an ID of 5
    2015-09-03 14:21:23.634 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -1572166
      },
      {
        "Hypothesis" : "AH A",
        "Score" : -1572638
      },
      {
        "Hypothesis" : "OH A",
        "Score" : -1572696
      },
      {
        "Hypothesis" : "O A",
        "Score" : -1572696
      },
      {
        "Hypothesis" : "OH AH A",
        "Score" : -1573206
      }
    ]
    2015-09-03 14:21:23.634 mathcommand[1591:483805] hypothesisArray is A,AH A,OH A,O A,OH AH A
    2015-09-03 14:21:23.830 mathcommand[1591:483965] Speech detected...
    2015-09-03 14:21:23.835 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:24.085 mathcommand[1591:483865] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 47.85  1.17 -7.23 -2.44 -13.78 -4.70 -7.25 -8.91 -3.97 -3.01 -0.88 -3.18  2.08 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 49.49  0.62 -7.32 -2.56 -14.25 -5.01 -7.48 -9.15 -3.13 -2.77 -0.17 -3.15  2.67 >
    INFO: ngram_search_fwdtree.c(1553):      328 words recognized (11/fr)
    INFO: ngram_search_fwdtree.c(1555):     7392 senones evaluated (238/fr)
    INFO: ngram_search_fwdtree.c(1559):     3547 channels searched (114/fr), 486 1st, 1611 last
    INFO: ngram_search_fwdtree.c(1562):      483 words for which last channels evaluated (15/fr)
    INFO: ngram_search_fwdtree.c(1564):      202 candidate words for entering last phone (6/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.29 CPU 0.926 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.47 wall 1.509 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 5 words
    2015-09-03 14:21:24.103 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdflat.c(948):      239 words recognized (8/fr)
    INFO: ngram_search_fwdflat.c(950):     3297 senones evaluated (106/fr)
    INFO: ngram_search_fwdflat.c(952):     1746 channels searched (56/fr)
    INFO: ngram_search_fwdflat.c(954):      354 words searched (11/fr)
    INFO: ngram_search_fwdflat.c(957):      146 word transitions (4/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.02 CPU 0.072 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.02 wall 0.053 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.26
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 86 nodes, 395 links
    INFO: ps_lattice.c(1380): Bestpath score: -5250
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:26:29) = 1681657
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1596689 P(S|O) = -84968
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.012 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.004 xRT
    2015-09-03 14:21:24.113 mathcommand[1591:483865] Pocketsphinx heard "I" with a score of (-84968) and an utterance ID of 6.
    2015-09-03 14:21:24.119 mathcommand[1591:483805] The received hypothesis is I with a score of -84968 and an ID of 6
    2015-09-03 14:21:24.119 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -67985
      },
      {
        "Hypothesis" : "",
        "Score" : -812856
      },
      {
        "Hypothesis" : "",
        "Score" : -813002
      },
      {
        "Hypothesis" : "",
        "Score" : -813074
      },
      {
        "Hypothesis" : "",
        "Score" : -813196
      }
    ]
    2015-09-03 14:21:24.120 mathcommand[1591:483805] hypothesisArray is ,,,,
    2015-09-03 14:21:24.213 mathcommand[1591:483955] Speech detected...
    2015-09-03 14:21:24.218 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:24.331 mathcommand[1591:483865] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 49.49  0.62 -7.32 -2.56 -14.25 -5.01 -7.48 -9.15 -3.13 -2.77 -0.17 -3.15  2.67 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 50.30  0.30 -7.52 -2.45 -14.36 -5.06 -7.69 -9.25 -3.07 -2.72  0.34 -2.94  2.71 >
    INFO: ngram_search_fwdtree.c(1553):      181 words recognized (10/fr)
    INFO: ngram_search_fwdtree.c(1555):     3494 senones evaluated (184/fr)
    INFO: ngram_search_fwdtree.c(1559):     1650 channels searched (86/fr), 270 1st, 800 last
    INFO: ngram_search_fwdtree.c(1562):      264 words for which last channels evaluated (13/fr)
    INFO: ngram_search_fwdtree.c(1564):      105 candidate words for entering last phone (5/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.17 CPU 0.869 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.22 wall 1.154 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 4 words
    2015-09-03 14:21:24.337 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdflat.c(948):      135 words recognized (7/fr)
    INFO: ngram_search_fwdflat.c(950):     1203 senones evaluated (63/fr)
    INFO: ngram_search_fwdflat.c(952):      519 channels searched (27/fr)
    INFO: ngram_search_fwdflat.c(954):      183 words searched (9/fr)
    INFO: ngram_search_fwdflat.c(957):       72 word transitions (3/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.01 CPU 0.055 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.049 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.12
    INFO: ngram_search.c(1306): Eliminated 2 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 67 nodes, 129 links
    INFO: ps_lattice.c(1380): Bestpath score: -2685
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:12:17) = 1775616
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1709176 P(S|O) = -66440
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.003 xRT
    2015-09-03 14:21:24.348 mathcommand[1591:483865] Pocketsphinx heard "A" with a score of (-66440) and an utterance ID of 7.
    2015-09-03 14:21:24.352 mathcommand[1591:483805] The received hypothesis is A with a score of -66440 and an ID of 7
    2015-09-03 14:21:24.353 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -23773
      },
      {
        "Hypothesis" : "",
        "Score" : -65559
      },
      {
        "Hypothesis" : "A",
        "Score" : -790154
      },
      {
        "Hypothesis" : "A",
        "Score" : -790303
      },
      {
        "Hypothesis" : "A",
        "Score" : -790332
      }
    ]
    2015-09-03 14:21:24.354 mathcommand[1591:483805] hypothesisArray is A,,A,A,A
    2015-09-03 14:21:24.859 mathcommand[1591:483955] Speech detected...
    2015-09-03 14:21:24.869 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:24.980 mathcommand[1591:483965] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 50.30  0.30 -7.52 -2.45 -14.36 -5.06 -7.69 -9.25 -3.07 -2.72  0.34 -2.94  2.71 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 50.87  0.49 -6.92 -2.47 -14.54 -4.87 -7.81 -9.22 -2.63 -2.63  0.40 -2.64  3.03 >
    INFO: ngram_search_fwdtree.c(1553):      196 words recognized (10/fr)
    INFO: ngram_search_fwdtree.c(1555):     3399 senones evaluated (179/fr)
    INFO: ngram_search_fwdtree.c(1559):     1554 channels searched (81/fr), 270 1st, 840 last
    INFO: ngram_search_fwdtree.c(1562):      270 words for which last channels evaluated (14/fr)
    INFO: ngram_search_fwdtree.c(1564):       47 candidate words for entering last phone (2/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.46 CPU 2.397 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.63 wall 3.336 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 6 words
    2015-09-03 14:21:24.990 mathcommand[1591:483805] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdflat.c(948):      135 words recognized (7/fr)
    INFO: ngram_search_fwdflat.c(950):     1377 senones evaluated (72/fr)
    INFO: ngram_search_fwdflat.c(952):      585 channels searched (30/fr)
    INFO: ngram_search_fwdflat.c(954):      213 words searched (11/fr)
    INFO: ngram_search_fwdflat.c(957):      108 word transitions (5/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.01 CPU 0.068 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.068 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.13
    INFO: ngram_search.c(1306): Eliminated 0 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 49 nodes, 171 links
    INFO: ps_lattice.c(1380): Bestpath score: -2817
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:13:17) = 1792958
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1721004 P(S|O) = -71954
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.003 xRT
    2015-09-03 14:21:25.000 mathcommand[1591:483965] Pocketsphinx heard "A" with a score of (-71954) and an utterance ID of 8.
    2015-09-03 14:21:25.003 mathcommand[1591:483805] The received hypothesis is A with a score of -71954 and an ID of 8
    2015-09-03 14:21:25.004 mathcommand[1591:483805] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -23905
      },
      {
        "Hypothesis" : "A A",
        "Score" : -24537
      },
      {
        "Hypothesis" : "",
        "Score" : -65818
      },
      {
        "Hypothesis" : "A",
        "Score" : -790302
      },
      {
        "Hypothesis" : "A",
        "Score" : -790407
      }
    ]
    2015-09-03 14:21:25.005 mathcommand[1591:483805] hypothesisArray is A,A A,,A,A
    2015-09-03 14:21:25.115 mathcommand[1591:483865] Speech detected...
    2015-09-03 14:21:25.119 mathcommand[1591:483805] Pocketsphinx has detected speech.
    2015-09-03 14:21:25.707 mathcommand[1591:483805] routeChangeReason : AVAudioSessionRouteChangeReasonNewDeviceAvailable
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
          - channelName: Headset Microphone
            - owningPortUID: Wired Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000476
    - inputGain: 0.763158
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 14:21:25.716 mathcommand[1591:483805] Audio route has changed for the following reason:
    2015-09-03 14:21:25.721 mathcommand[1591:483805] A new device is available
    2015-09-03 14:21:25.721 mathcommand[1591:483805] The audio input is available
    2015-09-03 14:21:25.722 mathcommand[1591:483965] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-09-03 14:21:25.724 mathcommand[1591:483805] This is a case for performing a route change. Before the route change, the current route was HeadphonesMicrophoneWired. Performing route change.
    2015-09-03 14:21:25.734 mathcommand[1591:483805] Audio route change. The new audio route is HeadphonesMicrophoneWired
    2015-09-03 14:21:25.735 mathcommand[1591:483805] Stopping listening.
    2015-09-03 14:21:27.162 mathcommand[1591:483805] 14:21:27.161 ERROR:     [0x37a9f9dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 14:21:27.163 mathcommand[1591:483805] Error: couldn't set session inactive.: '!act'
    2015-09-03 14:21:27.172 mathcommand[1591:483805] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-09-03 14:21:27.173 mathcommand[1591:483805] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-09-03 14:21:27.224 mathcommand[1591:483805] Attempting to stop an unstopped utterance so listening can stop.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 50.87  0.49 -6.92 -2.47 -14.54 -4.87 -7.81 -9.22 -2.63 -2.63  0.40 -2.64  3.03 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 51.13  0.71 -6.81 -2.38 -14.46 -4.81 -7.81 -9.21 -2.55 -2.53  0.46 -2.45  3.02 >
    INFO: ngram_search_fwdtree.c(1553):       49 words recognized (5/fr)
    INFO: ngram_search_fwdtree.c(1555):      807 senones evaluated (90/fr)
    INFO: ngram_search_fwdtree.c(1559):      389 channels searched (43/fr), 90 1st, 261 last
    INFO: ngram_search_fwdtree.c(1562):       89 words for which last channels evaluated (9/fr)
    INFO: ngram_search_fwdtree.c(1564):        9 candidate words for entering last phone (1/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.45 CPU 5.013 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 2.23 wall 24.733 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 1 words
    INFO: ngram_search_fwdflat.c(948):       30 words recognized (3/fr)
    INFO: ngram_search_fwdflat.c(950):      114 senones evaluated (13/fr)
    INFO: ngram_search_fwdflat.c(952):       48 channels searched (5/fr)
    INFO: ngram_search_fwdflat.c(954):       48 words searched (5/fr)
    INFO: ngram_search_fwdflat.c(957):        8 word transitions (0/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.026 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.025 xRT
    INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 4.96 CPU 1.484 xRT
    INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 12.19 wall 3.648 xRT
    INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.15 CPU 0.045 xRT
    INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.12 wall 0.035 xRT
    INFO: ngram_search.c(307): TOTAL bestpath 0.03 CPU 0.008 xRT
    INFO: ngram_search.c(310): TOTAL bestpath 0.02 wall 0.006 xRT
    2015-09-03 14:21:27.234 mathcommand[1591:483805] No longer listening.
    2015-09-03 14:21:27.235 mathcommand[1591:483805] Pocketsphinx has stopped listening.
    2015-09-03 14:21:27.236 mathcommand[1591:483965] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-09-03 14:21:27.253 mathcommand[1591:483805] 14:21:27.253 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:27.253 mathcommand[1591:483805] 14:21:27.253 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:27.258 mathcommand[1591:483805] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 14:21:27.260 mathcommand[1591:483805] Audio route has changed for the following reason:
    2015-09-03 14:21:27.260 mathcommand[1591:483805] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 14:21:27.263 mathcommand[1591:483805] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Headphones---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x175429d0, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x1752b870, type = MicrophoneWired; name = Headset Microphone; UID = Wired Microphone; selectedDataSource = (null)>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x17300080, type = Headphones; name = Headphones; UID = Wired Headphones; selectedDataSource = (null)>"
    )>.
    [PocketSphinx] Stop Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 14:21:33.837 mathcommand[1591:483805] 14:21:33.837 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:33.837 mathcommand[1591:483805] 14:21:33.837 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 14:21:33.841 mathcommand[1591:483805] routeChangeReason : AVAudioSessionRouteChangeReasonOldDeviceUnavailable
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 14:21:33.843 mathcommand[1591:483805] Audio route has changed for the following reason:
    2015-09-03 14:21:33.844 mathcommand[1591:483805] An old device became unavailable
    2015-09-03 14:21:33.844 mathcommand[1591:483805] The audio input has become unavailable
    2015-09-03 14:21:33.844 mathcommand[1591:483805] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.
    2015-09-03 14:21:33.844 mathcommand[1591:483805] the audio input is now unavailable.
    2015-09-03 14:21:33.845 mathcommand[1591:483805] This is a case for performing a route change. Before the route change, the current route was Speaker. Performing route change.
    2015-09-03 14:21:33.846 mathcommand[1591:483805] Audio route change. The new audio route is Speaker
    2015-09-03 14:21:33.846 mathcommand[1591:483805] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.
    2015-09-03 14:21:33.851 mathcommand[1591:483866] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    

    Again, I’m dumping the full audio settings at every route change.
    I can see that OpenEars is using a different category than Unity was: AVAudioSessionCategoryPlayAndRecord.
    Another thing was the sample rate: my app started at 24000, and then changed to 44100 after plugging the headphones.
    I didn’t notice any other settings being changed during my dumps (I may be missing something though).

    I have then proceeded to set the sample rate to 44100 from the start of my app to see if anything would change, but the problem still remained. The logs were all the same.

    I think the key here is this error:

    2015-09-03 14:21:27.162 mathcommand[1591:483805] 14:21:27.161 ERROR:     [0x37a9f9dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 14:21:27.163 mathcommand[1591:483805] Error: couldn't set session inactive.: '!act'
    2015-09-03 14:21:27.172 mathcommand[1591:483805] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    

    I have even tried stopping all my audio playback before unplugging the headphones, but I always get this error during stopListening().
    Could this be the reason of the StopListening() failure?

    One more thing I should add: With OpenEars 1.x StopListening() used to work well, but since upgrading to 2.x I’ve been having these issues related to anything concerning StopListening() calls. I thought leaving my app free of StopListening() calls would solve the issue, but I guess I was wrong.

    #1026696
    Halle Winkler
    Politepix

    Hi,

    Thanks for the additional output, but I don’t think it is productive to focus on route changes since the issue is happening at any call to stopListening() in your report. A route change is just one thing that is resulting in a call to stopListening, so looking at the Unity route change behavior means that we’re focusing on something with a non-causal relationship to the behavior we’re troubleshooting (i.e. although a route change is present when stopListening doesn’t work, the route change is known to be a bad candidate for being the reason for stopListening not working because there are no other situations in which stopListening works).

    IMO the case to check out would be the most minimal possible failure of stopListening, i.e. starting the app, immediately starting listening, possibly recognizing a single word, and then stopping with a stopListening failure, and then stopping the app. At that point we’re interested in all of the possible Unity audio output about what it is doing when listening is started and stopped, and seeing the entire OpenEars logging output for the entire (very short) app session.

    #1026697
    pizigi
    Participant

    Thanks for the quick input Halle.
    That’s a very good idea, to stop worrying about the headphone route changes and focus only on simple StopListening() calls.
    You’re right that all StopListening() calls fail, this will make testing easier and the logs smaller.

    I have modified my app to start OpenEars and after it’s fully initialized it waits 3 seconds and then calls StopListening().
    I play no audio at all in this test.

    Here’s the full log:

    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:17.844 mathcommand[1655:497815] 15:48:17.844 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 15:48:17.845 mathcommand[1655:497815] 15:48:17.844 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 15:48:17.852 mathcommand[1655:497815] 
    Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 15:48:17.853 mathcommand[1655:497815] [PocketSphinx] Startup
    2015-09-03 15:48:17.855 mathcommand[1655:497815] Starting OpenEars logging for OpenEars version 2.041 on 32-bit device (or build): iPhone running iOS version: 8.400000
    2015-09-03 15:48:17.856 mathcommand[1655:497815] [PocketSphinx] SetupLanguage: English
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:18.882 mathcommand[1655:497815] [PocketSphinx] Start Recording
    2015-09-03 15:48:18.883 mathcommand[1655:498046] Creating shared instance of OEPocketsphinxController
    2015-09-03 15:48:18.885 mathcommand[1655:498046] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 15:48:18.886 mathcommand[1655:498046] User gave mic permission for this app.
    2015-09-03 15:48:18.887 mathcommand[1655:498046] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-09-03 15:48:18.889 mathcommand[1655:498046] Successfully started listening session from startListeningWithLanguageModelAtPath:
    [PocketSphinx] Recognition Setup Completed
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:18.890 mathcommand[1655:498079] Starting listening.
    2015-09-03 15:48:18.890 mathcommand[1655:498079] about to set up audio session
    -> applicationWillResignActive()
    2015-09-03 15:48:19.412 mathcommand[1655:498079] Creating audio session with default settings.
    2015-09-03 15:48:19.458 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 15:48:19.459 mathcommand[1655:498079] done starting audio unit
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpath yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]2015-09-03 15:48:19.465 mathcommand[1655:497815] Audio route has changed for the following reason:
    			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0		2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -bestpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -2015-09-03 15:48:19.476 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase				
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -mllr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    2015-09-03 15:48:19.483 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x192118d0, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x194cfde0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    2015-09-03 15:48:19.507 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/mdef
    2015-09-03 15:48:19.517 mathcommand[1655:497815] Audio route has changed for the following reason:
    2015-09-03 15:48:19.528 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 15:48:19.531 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x17f15850, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x17f14e90, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x1920e640, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-09-03 15:48:19.646 mathcommand[1655:498079] There was no previous CMN value in the plist so we are using the fresh CMN value 42.000000.
    2015-09-03 15:48:19.647 mathcommand[1655:498079] Listening.
    2015-09-03 15:48:19.647 mathcommand[1655:497815] Pocketsphinx is now listening.
    2015-09-03 15:48:19.648 mathcommand[1655:498079] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-09-03 15:48:19.649 mathcommand[1655:497815] Pocketsphinx is starting up.
    2015-09-03 15:48:19.649 mathcommand[1655:498079] Recognition loop has started
    2015-09-03 15:48:19.888 mathcommand[1655:498079] Speech detected...
    2015-09-03 15:48:19.888 mathcommand[1655:497815] Pocketsphinx has detected speech.
    -> applicationDidBecomeActive()
    
    [PocketSphinx] Start Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    LoadingScreen: OnStartListening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:20.116 mathcommand[1655:498046] End of speech detected...
    2015-09-03 15:48:20.117 mathcommand[1655:497815] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 42.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ngram_search_fwdtree.c(1553):      271 words recognized (9/fr)
    INFO: ngram_search_fwdtree.c(1555):     4537 senones evaluated (151/fr)
    INFO: ngram_search_fwdtree.c(1559):     1923 channels searched (64/fr), 468 1st, 795 last
    INFO: ngram_search_fwdtree.c(1562):      417 words for which last channels evaluated (13/fr)
    INFO: ngram_search_fwdtree.c(1564):       72 candidate words for entering last phone (2/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.11 CPU 0.365 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.28 wall 0.918 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 8 words
    INFO: ngram_search_fwdflat.c(948):      237 words recognized (8/fr)
    INFO: ngram_search_fwdflat.c(950):     2246 senones evaluated (75/fr)
    INFO: ngram_search_fwdflat.c(952):     1083 channels searched (36/fr)
    INFO: ngram_search_fwdflat.c(954):      393 words searched (13/fr)
    INFO: ngram_search_fwdflat.c(957):      229 word transitions (7/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.010 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.015 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.22
    INFO: ngram_search.c(1306): Eliminated 2 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 124 nodes, 588 links
    INFO: ps_lattice.c(1380): Bestpath score: -3012
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:22:28) = 1771340
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1708921 P(S|O) = -62419
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.003 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.006 xRT
    2015-09-03 15:48:20.133 mathcommand[1655:498046] Pocketsphinx heard "A" with a score of (-62419) and an utterance ID of 0.
    2015-09-03 15:48:20.134 mathcommand[1655:497815] The received hypothesis is A with a score of -62419 and an ID of 0
    2015-09-03 15:48:20.135 mathcommand[1655:497815] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -24100
      },
      {
        "Hypothesis" : "E",
        "Score" : -24131
      },
      {
        "Hypothesis" : "A",
        "Score" : -24229
      },
      {
        "Hypothesis" : "",
        "Score" : -65936
      },
      {
        "Hypothesis" : "A",
        "Score" : -790462
      }
    ]
    2015-09-03 15:48:20.136 mathcommand[1655:497815] hypothesisArray is A,E,A,,A
    Recognition callback: A,E,A,,A
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.02041435 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Avg mic level: 0.05581997
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didCacheInterstitial: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:22.922 mathcommand[1655:497815] [PocketSphinx] Stop Listening
    2015-09-03 15:48:22.922 mathcommand[1655:498046] Stopping listening.
    Chartboost: didCacheRewardedVideo: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 15:48:24.399 mathcommand[1655:498046] 15:48:24.399 ERROR:     [0xd8de000] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 15:48:24.400 mathcommand[1655:498046] Error: couldn't set session inactive.: '!act'
    2015-09-03 15:48:24.415 mathcommand[1655:498046] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-09-03 15:48:24.416 mathcommand[1655:498046] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-09-03 15:48:24.471 mathcommand[1655:498046] Attempting to stop an unstopped utterance so listening can stop.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 0 words
    INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 1.41 CPU 4.869 xRT
    INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 4.61 wall 15.883 xRT
    INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.00 CPU 0.010 xRT
    INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.00 wall 0.016 xRT
    INFO: ngram_search.c(307): TOTAL bestpath 0.00 CPU 0.003 xRT
    INFO: ngram_search.c(310): TOTAL bestpath 0.00 wall 0.006 xRT
    2015-09-03 15:48:24.474 mathcommand[1655:498046] No longer listening.
    2015-09-03 15:48:24.487 mathcommand[1655:497815] 15:48:24.487 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 15:48:24.488 mathcommand[1655:497815] 15:48:24.488 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 15:48:24.493 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.085333
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013292
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 48000.000000
    - recordPermission: 1735552628
    - sampleRate: 48000.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 15:48:24.495 mathcommand[1655:497815] Audio route has changed for the following reason:
    2015-09-03 15:48:24.495 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 15:48:24.497 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Speaker---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x19258f50, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x192b68f0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x17f25900, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    2015-09-03 15:48:24.498 mathcommand[1655:497815] Pocketsphinx has stopped listening.
    [PocketSphinx] Stop Listening

    The I/O stop error still shows up.
    I still don’t have more details on the Unity audio behavior other than the audio session settings dumps, however.
    Could you give me some pointers on what kind of audio information I should be adding to the logs so I can look further? The AVAudioSession settings are not enough I suppose?

    #1026698
    Halle Winkler
    Politepix

    OK, so this log says that listening has stopped at the end (I’m assuming that you’re logging “Pocketsphinx has stopped listening.” is called in the “pocketsphinxHasStoppedListening” delegate method), so stopListening is seemingly completing, which I think leaves the issue as not being able to restart after stopping, not that there is an issue with stopping. I think you’re correct that the issue is here:

    2015-09-03 15:48:24.399 mathcommand[1655:498046] 15:48:24.399 ERROR:     [0xd8de000] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 15:48:24.400 mathcommand[1655:498046] Error: couldn't set session inactive.: '!act'
    2015-09-03 15:48:24.415 mathcommand[1655:498046] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    

    This means that Unity is still using audio IO although OpenEars isn’t, which is going to be the probable reason that recording doesn’t work again in the second start. There is an additional issue which appears early on in the logs, which is that Unity tries to reassert its own session settings after OpenEars sets them, which I would guess is negatively affecting recognition since neither 24k or 41.1k are sample rates that OpenEars can perform recognition with.

    It is probably a requirement for normal usage of OpenEars that you learn how to shut down Unity’s audio IO before starting OpenEars and how to restart Unity’s audio IO after stopping OpenEars.

    If you want to verify what is happening, you can now do a minimal session that shows starting, stopping, and then starting again, demonstrating the failure to start the second time. That may have some very informative logging out of OpenEars during the second start attempt.

    #1026703
    pizigi
    Participant

    (this will be a long post, as it has two full logs in it)

    First, just a quick note about the sample rate.
    I just ran the OpenEars sample app, and dumped the AudioSession settings after StartListening() completed. As you can see, it also shows 44100 for the sample rate:

    
    2015-09-03 15:03:38.921 OpenEarsSampleApp[1619:490393] Local callback: Pocketsphinx is now listening.
    2015-09-03 15:03:38.973 OpenEarsSampleApp[1619:490393] 
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 0.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0

    My guess is that sample rate I dumped is not the same setting OpenEars uses for its recognition (if you say 44100 is not what is being used).

    Back to the problem at hand, I tried doing just what you mentioned, calling StartListening() after StopListening() completed.
    And guess what, it worked. Even though that I/O error showed up, OpenEars still managed to restart listening.

    Here’s the log:

    
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:50.508 mathcommand[1891:540340] 19:02:50.507 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:02:50.508 mathcommand[1891:540340] 19:02:50.508 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:02:50.521 mathcommand[1891:540340] 
    Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:02:50.522 mathcommand[1891:540340] [PocketSphinx] Startup
    2015-09-03 19:02:50.523 mathcommand[1891:540340] Starting OpenEars logging for OpenEars version 2.041 on 32-bit device (or build): iPhone running iOS version: 8.400000
    2015-09-03 19:02:50.524 mathcommand[1891:540340] [PocketSphinx] SetupLanguage: English
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:51.532 mathcommand[1891:540340] [PocketSphinx] Start Recording
    2015-09-03 19:02:51.532 mathcommand[1891:540452] Creating shared instance of OEPocketsphinxController
    2015-09-03 19:02:51.534 mathcommand[1891:540452] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:02:51.535 mathcommand[1891:540452] User gave mic permission for this app.
    2015-09-03 19:02:51.535 mathcommand[1891:540452] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-09-03 19:02:51.535 mathcommand[1891:540452] Successfully started listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:02:51.535 mathcommand[1891:540407] Starting listening.
    [PocketSphinx] Recognition Setup Completed
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:51.536 mathcommand[1891:540407] about to set up audio session
    -> applicationWillResignActive()
    2015-09-03 19:02:51.872 mathcommand[1891:540407] Creating audio session with default settings.
    2015-09-03 19:02:51.911 mathcommand[1891:540407] done starting audio unit
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpath yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0		2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -be2015-09-03 19:02:51.921 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    stpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase				
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    2015-09-03 19:02:51.925 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:02:51.929 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -mllr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    2015-09-03 19:02:51.930 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1839b3f0, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x183904f0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    2015-09-03 19:02:51.975 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:02:51.985 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:02:51.985 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:02:51.987 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1821c080, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x18379ba0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x1807b560, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-09-03 19:02:52.079 mathcommand[1891:540407] Restoring SmartCMN value of 30.914795
    2015-09-03 19:02:52.080 mathcommand[1891:540407] Listening.
    2015-09-03 19:02:52.080 mathcommand[1891:540340] Pocketsphinx is now listening.
    2015-09-03 19:02:52.081 mathcommand[1891:540407] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-09-03 19:02:52.081 mathcommand[1891:540407] Recognition loop has started
    2015-09-03 19:02:52.081 mathcommand[1891:540340] Pocketsphinx is starting up.
    -> applicationDidBecomeActive()
    [GameStore] Unexpected Error in Store: 
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    [GameStore] Unexpected Error in Store: 
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    [GameStore] - Market Item: remove_ads
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    [PocketSphinx] Start Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    LoadingScreen: OnStartListening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:52.390 mathcommand[1891:540408] Speech detected...
    2015-09-03 19:02:52.392 mathcommand[1891:540340] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:52.741 mathcommand[1891:540408] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 30.91  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 41.39  1.94 -2.46 14.27  5.01  1.48 -4.35  8.06 -1.51  5.23  2.69 14.05 10.51 >
    INFO: ngram_search_fwdtree.c(1553):     1062 words recognized (16/fr)
    INFO: ngram_search_fwdtree.c(1555):    22693 senones evaluated (339/fr)
    INFO: ngram_search_fwdtree.c(1559):    13775 channels searched (205/fr), 1134 1st, 8175 last
    INFO: ngram_search_fwdtree.c(1562):     1292 words for which last channels evaluated (19/fr)
    INFO: ngram_search_fwdtree.c(1564):      507 candidate words for entering last phone (7/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.24 CPU 0.359 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.63 wall 0.945 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 15 words
    INFO: ngram_search_fwdflat.c(948):      935 words recognized (14/fr)
    INFO: ngram_search_fwdflat.c(950):    20592 senones evaluated (307/fr)
    INFO: ngram_search_fwdflat.c(952):    14800 channels searched (220/fr)
    INFO: ngram_search_fwdflat.c(954):     1433 words searched (21/fr)
    INFO: ngram_search_fwdflat.c(957):      735 word transitions (10/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.01 CPU 0.016 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.017 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.63
    INFO: ngram_search.c(1306): Eliminated 6 nodes before end node
    2015-09-03 19:02:52.755 mathcommand[1891:540340] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search.c(1411): Lattice has 249 nodes, 2350 links
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ps_lattice.c(1380): Bestpath score: -9658
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:63:65) = -477831
    INFO: ps_lattice.c(1441): Joint P(O,S) = -561285 P(S|O) = -83454
    INFO: ngram_search.c(899): bestpath 0.01 CPU 0.013 xRT
    INFO: ngram_search.c(902): bestpath 0.01 wall 0.010 xRT
    2015-09-03 19:02:52.759 mathcommand[1891:540408] Pocketsphinx heard "A" with a score of (-83454) and an utterance ID of 0.
    2015-09-03 19:02:52.772 mathcommand[1891:540340] The received hypothesis is A with a score of -83454 and an ID of 0
    2015-09-03 19:02:52.773 mathcommand[1891:540340] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -518728
      },
      {
        "Hypothesis" : "A",
        "Score" : -818075
      },
      {
        "Hypothesis" : "",
        "Score" : -818328
      },
      {
        "Hypothesis" : "I",
        "Score" : -818346
      },
      {
        "Hypothesis" : "A",
        "Score" : -818535
      }
    ]
    2015-09-03 19:02:52.774 mathcommand[1891:540340] hypothesisArray is A,A,,I,A
    Avg mic level: 0.1288876
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Recognition callback: A,A,,I,A
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.01911592 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:53.019 mathcommand[1891:540407] Speech detected...
    2015-09-03 19:02:53.022 mathcommand[1891:540340] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:53.137 mathcommand[1891:540392] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 41.39  1.94 -2.46 14.27  5.01  1.48 -4.35  8.06 -1.51  5.23  2.69 14.05 10.51 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 43.62  3.32 -5.02 19.04  4.52  1.50 -10.06  3.52 -1.31  1.42  2.15  9.51  7.21 >
    2015-09-03 19:02:53.138 mathcommand[1891:540340] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdtree.c(1553):      380 words recognized (14/fr)
    INFO: ngram_search_fwdtree.c(1555):     7938 senones evaluated (294/fr)
    INFO: ngram_search_fwdtree.c(1559):     4890 channels searched (181/fr), 414 1st, 3138 last
    INFO: ngram_search_fwdtree.c(1562):      474 words for which last channels evaluated (17/fr)
    INFO: ngram_search_fwdtree.c(1564):      242 candidate words for entering last phone (8/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.10 CPU 0.372 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.38 wall 1.400 xRT
    INFO: ngram_Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    search_fwdflat.c(302): Utterance vocabulary contains 10 words
    INFO: ngram_search_fwdflat.c(948):      292 words recognized (11/fr)
    INFO: ngram_search_fwdflat.c(950):     5148 senones evaluated (191/fr)
    INFO: ngram_search_fwdflat.c(952):     3294 channels searched (122/fr)
    INFO: ngram_search_fwdflat.c(954):      417 words searched (15/fr)
    INFO: ngram_search_fwdflat.c(957):      260 word transitions (9/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.011 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.020 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.23
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 83 nodes, 439 links
    INFO: ps_lattice.c(1380): Bestpath score: -4058
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:23:25) = 1725838
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1670725 P(S|O) = -55113
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.014 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.004 xRT
    2015-09-03 19:02:53.146 mathcommand[1891:540392] Pocketsphinx heard "3" with a score of (-55113) and an utterance ID of 1.
    2015-09-03 19:02:53.155 mathcommand[1891:540340] The received hypothesis is 3 with a score of -55113 and an ID of 1
    2015-09-03 19:02:53.155 mathcommand[1891:540340] hypothesisArray is [
      {
        "Hypothesis" : "3",
        "Score" : -25146
      },
      {
        "Hypothesis" : "A",
        "Score" : -25360
      },
      {
        "Hypothesis" : "30",
        "Score" : -25500
      },
      {
        "Hypothesis" : "3 A",
        "Score" : -25680
      },
      {
        "Hypothesis" : "A A",
        "Score" : -25824
      }
    ]
    2015-09-03 19:02:53.156 mathcommand[1891:540340] hypothesisArray is 3,A,30,3 A,A A
    Recognition callback: 3,A,30,3 A,A A
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.01736546 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:53.520 mathcommand[1891:540392] Speech detected...
    2015-09-03 19:02:53.522 mathcommand[1891:540340] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:53.643 mathcommand[1891:540392] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 43.62  3.32 -5.02 19.04  4.52  1.50 -10.06  3.52 -1.31  1.42  2.15  9.51  7.21 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 43.64  8.34 -5.11 13.69 -1.30 -1.89 -10.47 -0.88 -3.84 -0.62  0.66  8.70  5.19 >
    INFO: ngram_search_fwdtree.c(1553):      200 words recognized (6/fr)
    INFO: ngram_search_fwdtree.c(1555):     5317 senones evaluated (161/fr)
    INFO: ngram_search_fwdtree.c(1559):     2430 channels searched (73/fr), 452 1st, 1497 last
    INFO: ngram_search_fwdtree.c(1562):      407 words for which last channels evaluated (12/fr)
    INFO: ngram_search_fwdtree.c(1564):       61 candidate words for entering last phone (1/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.19 CPU 0.570 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.50 wall 1.508 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 2 words
    INFO: ngram_search_fwdflat.c(948):      182 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):     2527 senones evaluated (77/fr)
    INFO: ngram_search_fwdflat.c(952):     1124 channels searched (34/fr)
    INFO: ngram_search_fwdflat.c(954):      293 words searched (8/fr)
    INFO: ngram_search_fwdflat.c(957):       55 word transitions (1/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.009 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.011 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.29
    INFO: ngram_search.c(1306): Eliminated 6 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 103 nodes, 107 links
    INFO: ps_lattice.c(1380): Bestpath score: -3856
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:29:31) = -246137
    INFO: ps_lattice.c(1441): Joint P(O,S) = -257003 P(S|O) = -10866
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.001 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.001 xRT
    2015-09-03 19:02:53.648 mathcommand[1891:540392] Pocketsphinx heard "4" with a score of (-10866) and an utterance ID of 2.
    2015-09-03 19:02:53.655 mathcommand[1891:540340] Pocketsphinx has detected a second of silence, concluding an utterance.
    2015-09-03 19:02:53.656 mathcommand[1891:540340] The received hypothesis is 4 with a score of -10866 and an ID of 2
    2015-09-03 19:02:53.656 mathcommand[1891:540340] hypothesisArray is [
      {
        "Hypothesis" : "4",
        "Score" : -24944
      },
      {
        "Hypothesis" : "4",
        "Score" : -512346
      },
      {
        "Hypothesis" : "4",
        "Score" : -812444
      },
      {
        "Hypothesis" : "4",
        "Score" : -812557
      },
      {
        "Hypothesis" : "4",
        "Score" : -812588
      }
    ]
    2015-09-03 19:02:53.656 mathcommand[1891:540340] hypothesisArray is 4,4,4,4,4
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Recognition callback: 4,4,4,4,4
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 5.197525E-05 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:02:55.192 mathcommand[1891:540340] [PocketSphinx] Stop Listening
    2015-09-03 19:02:55.192 mathcommand[1891:540452] Stopping listening.
    2015-09-03 19:02:56.584 mathcommand[1891:540452] 19:02:56.584 ERROR:     [0xd9c3000] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 19:02:56.585 mathcommand[1891:540452] Error: couldn't set session inactive.: '!act'
    2015-09-03 19:02:56.596 mathcommand[1891:540452] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-09-03 19:02:56.597 mathcommand[1891:540452] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-09-03 19:02:56.651 mathcommand[1891:540452] Attempting to stop an unstopped utterance so listening can stop.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 43.64  8.34 -5.11 13.69 -1.30 -1.89 -10.47 -0.88 -3.84 -0.62  0.66  8.70  5.19 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 43.64  8.34 -5.11 13.69 -1.30 -1.89 -10.47 -0.88 -3.84 -0.62  0.66  8.70  5.19 >
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 0 words
    INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 2.06 CPU 1.658 xRT
    INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 4.51 wall 3.638 xRT
    INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.02 CPU 0.013 xRT
    INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.02 wall 0.016 xRT
    INFO: ngram_search.c(307): TOTAL bestpath 0.01 CPU 0.010 xRT
    INFO: ngram_search.c(310): TOTAL bestpath 0.01 wall 0.006 xRT
    2015-09-03 19:02:56.654 mathcommand[1891:540452] No longer listening.
    2015-09-03 19:02:56.657 mathcommand[1891:540340] Pocketsphinx has stopped listening.
    2015-09-03 19:02:56.697 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:02:56.699 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:02:56.700 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:02:56.703 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x182bfa50, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x182dc800, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x1821b7d0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    2015-09-03 19:02:56.732 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:02:56.733 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:02:56.734 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:02:56.736 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x18423b10, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x181a4ab0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    [PocketSphinx] Stop Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didFailToLoadRewardedVideo: Internal at location Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didCacheInterstitial: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didCacheInterstitial: Main Menu
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:03:03.095 mathcommand[1891:540340] [PocketSphinx] Start Recording
    2015-09-03 19:03:03.096 mathcommand[1891:540408] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:03:03.096 mathcommand[1891:540408] User gave mic permission for this app.
    2015-09-03 19:03:03.096 mathcommand[1891:540408] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-09-03 19:03:03.097 mathcommand[1891:540408] Successfully started listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:03:03.097 mathcommand[1891:540407] Starting listening.
    2015-09-03 19:03:03.097 mathcommand[1891:540407] about to set up audio session
    2015-09-03 19:03:03.386 mathcommand[1891:540407] Creating audio session with default settings.
    2015-09-03 19:03:03.431 mathcommand[1891:540407] done starting audio unit
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpath yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0		2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -be2015-09-03 19:03:03.435 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    stpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase				
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -mllr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    2015-09-03 19:03:03.439 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:03:03.441 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:03:03.443 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1848e060, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x181b5fd0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x181002b0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-orde2015-09-03 19:03:03.467 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:03:03.473 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:03:03.474 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:03:03.476 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1844cef0, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x18489da0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    r mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/mdef
    2015-09-03 19:03:03.498 mathcommand[1891:540340] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:03:03.500 mathcommand[1891:540340] Audio route has changed for the following reason:
    2015-09-03 19:03:03.500 mathcommand[1891:540340] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:03:03.502 mathcommand[1891:540340] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x183c47c0, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x183c5b60, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x183575f0, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/CE04361D-0065-4F9A-AD73-B1621E093840/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-09-03 19:03:03.533 mathcommand[1891:540407] Restoring SmartCMN value of 43.644531
    2015-09-03 19:03:03.534 mathcommand[1891:540407] Listening.
    2015-09-03 19:03:03.534 mathcommand[1891:540340] Pocketsphinx is now listening.
    2015-09-03 19:03:03.535 mathcommand[1891:540407] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-09-03 19:03:03.535 mathcommand[1891:540407] Recognition loop has started
    2015-09-03 19:03:03.535 mathcommand[1891:540340] Pocketsphinx is starting up.
    [PocketSphinx] Start Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:03:03.935 mathcommand[1891:540393] Speech detected...
    2015-09-03 19:03:03.936 mathcommand[1891:540340] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:03:04.299 mathcommand[1891:540408] End of speech detected...
    2015-09-03 19:03:04.300 mathcommand[1891:540340] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 43.64  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 30.67 -4.16 -9.52 -6.33 -4.23  0.26  1.10 -0.19 -2.82  3.90  0.45  1.74  2.67 >
    INFO: ngram_search_fwdtree.c(1553):      270 words recognized (6/fr)
    INFO: ngram_search_fwdtree.c(1555):     3985 senones evaluated (89/fr)
    INFO: ngram_search_fwdtree.c(1559):     1423 channels searched (31/fr), 738 1st, 507 last
    INFO: ngram_search_fwdtree.c(1562):      507 words for which last channels evaluated (11/fr)
    INFO: ngram_search_fwdtree.c(1564):        0 candidate words for entering last phone (0/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.27 CPU 0.609 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.51 wall 1.127 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 2 words
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ngram_search_fwdflat.c(948):      270 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):      870 senones evaluated (19/fr)
    INFO: ngram_search_fwdflat.c(952):      372 channels searched (8/fr)
    INFO: ngram_search_fwdflat.c(954):      372 words searched (8/fr)
    INFO: ngram_search_fwdflat.c(957):       55 word transitions (1/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.02 CPU 0.037 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.02 wall 0.039 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.3
    INFO: ngram_search.c(1306): Eliminated 6 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 146 nodes, 1 links
    INFO: ps_lattice.c(1380): Bestpath score: -42848
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:3:43) = -2833449
    INFO: ps_lattice.c(1441): Joint P(O,S) = -2833450 P(S|O) = -1
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.001 xRT
    2015-09-03 19:03:04.322 mathcommand[1891:540408] Pocketsphinx heard "" with a score of (-1) and an utterance ID of 3.
    2015-09-03 19:03:04.329 mathcommand[1891:540340] The received hypothesis is  with a score of -1 and an ID of 3
    2015-09-03 19:03:04.329 mathcommand[1891:540340] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -63936
      }
    ]
    2015-09-03 19:03:04.330 mathcommand[1891:540340] hypothesisArray is 
    Recognition callback: 
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.0310421 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:03:06.379 mathcommand[1891:540407] Speech detected...
    2015-09-03 19:03:06.380 mathcommand[1891:540340] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:03:06.757 mathcommand[1891:540393] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 30.67 -4.16 -9.52 -6.33 -4.23  0.26  1.10 -0.19 -2.82  3.90  0.45  1.74  2.67 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 38.35 -7.24 -1.23 -2.53  6.26 -4.75 -2.75  0.82 -3.54  7.41  2.83  2.70  5.07 >
    INFO: ngram_search_fwdtree.c(1553):      459 words recognized (8/fr)
    INFO: ngram_search_fwdtree.c(1555):    12594 senones evaluated (217/fr)
    INFO: ngram_search_fwdtree.c(1559):     7267 channels searched (125/fr), 791 1st, 3567 last
    INFO: ngram_search_fwdtree.c(1562):      711 words for which last channels evaluated (12/fr)
    INFO: ngram_search_fwdtree.c(1564):      206 candidate words for entering last phone (3/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 1.34 CPU 2.304 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 2.44 wall 4.200 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 7 words
    2015-09-03 19:03:06.762 mathcommand[1891:540340] Pocketsphinx has detected a second of silence, concluding an utterance.
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ngram_search_fwdflat.c(948):      344 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):    11738 senones evaluated (202/fr)
    INFO: ngram_search_fwdflat.c(952):     6923 channels searched (119/fr)
    INFO: ngram_search_fwdflat.c(954):      756 words searched (13/fr)
    INFO: ngram_search_fwdflat.c(957):      219 word transitions (3/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.04 CPU 0.062 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.03 wall 0.046 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.42
    INFO: ngram_search.c(1306): Eliminated 1 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 60 nodes, 56 links
    INFO: ps_lattice.c(1380): Bestpath score: -6591
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:42:56) = -477470
    INFO: ps_lattice.c(1441): Joint P(O,S) = -492063 P(S|O) = -14593
    INFO: ngram_search.c(899): bestpath -0.00 CPU -0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.001 xRT
    2015-09-03 19:03:06.787 mathcommand[1891:540393] Pocketsphinx heard "6" with a score of (-14593) and an utterance ID of 4.
    2015-09-03 19:03:06.788 mathcommand[1891:540340] The received hypothesis is 6 with a score of -14593 and an ID of 4
    2015-09-03 19:03:06.789 mathcommand[1891:540340] hypothesisArray is [
      {
        "Hypothesis" : "6",
        "Score" : -27679
      },
      {
        "Hypothesis" : "7",
        "Score" : -28109
      },
      {
        "Hypothesis" : "6",
        "Score" : -515154
      },
      {
        "Hypothesis" : "7",
        "Score" : -515262
      },
      {
        "Hypothesis" : "30",
        "Score" : -515421
      }
    ]
    2015-09-03 19:03:06.789 mathcommand[1891:540340] hypothesisArray is 6,7,6,7,30
    Recognition callback: 6,7,6,7,30
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.01649857 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    

    I even modified to app to play some music before running this test, and I got the same result: StarListening() still works after StopListening().

    So I was wrong in saying StopListening() fails every time, it actually doesn’t fail (except for that headphones case).
    In fact, I was avoiding StopListening() because of this quirk: it causes all my audio output to stop, and I can’t manage to get anything to play anymore unless I reset the Unity audio settings.
    I usually reset the audio settings just before calling StartListening(), so OpenEars can still override my settings and it works reasonably well, but I opted to avoid calling StopListening() if I could.

    So, back to the original issue about the OEPocketSphinxController stuck in a locked state, it really happens only when plugging in the headphones.
    I ran the same test again, except that I quickly plugged in the headphones before it called StopListening, and I ended up with the same issue as my original post.
    Here is the sequence of actions in the test:
    – Start application
    – Start up OpenEars, call StartListening()
    – After StartListening completes, I plug in the headphones
    – After a few seconds, I unplug the headphones
    – 20 seconds after app startup, the application tries to call StopListening()
    – 30 seconds after app startup, the application tries to call StartListening()

    Here is the log (I added some comments to help find the last two calls to StopListening and StartListening, respectively):

    
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:08.173 mathcommand[1946:550412] 19:59:08.173 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:08.173 mathcommand[1946:550412] 19:59:08.173 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:08.178 mathcommand[1946:550412] 
    Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:08.179 mathcommand[1946:550412] [PocketSphinx] Startup
    2015-09-03 19:59:08.179 mathcommand[1946:550412] Starting OpenEars logging for OpenEars version 2.041 on 32-bit device (or build): iPhone running iOS version: 8.400000
    2015-09-03 19:59:08.180 mathcommand[1946:550412] [PocketSphinx] SetupLanguage: English
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:08.993 mathcommand[1946:550412] [PocketSphinx] Start Recording
    2015-09-03 19:59:08.993 mathcommand[1946:550450] Creating shared instance of OEPocketsphinxController
    2015-09-03 19:59:08.993 mathcommand[1946:550450] Attempting to start listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:59:08.994 mathcommand[1946:550450] User gave mic permission for this app.
    2015-09-03 19:59:08.994 mathcommand[1946:550450] Valid setSecondsOfSilence value of 0.100000 will be used.
    2015-09-03 19:59:08.995 mathcommand[1946:550450] Successfully started listening session from startListeningWithLanguageModelAtPath:
    2015-09-03 19:59:08.995 mathcommand[1946:550467] Starting listening.
    2015-09-03 19:59:08.995 mathcommand[1946:550467] about to set up audio session
    [PocketSphinx] Recognition Setup Completed
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:09.300 mathcommand[1946:550467] Creating audio session with default settings.
    2015-09-03 19:59:09.338 mathcommand[1946:550467] done starting audio unit
    2015-09-03 19:59:09.341 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:09.348 mathcommand[1946:550412] Audio route has changed for the following reason:
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-lm /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
    	-vad_prespeech 10 \
    	-vad_postspeech 10 \
    	-vad_threshold 2.500000 \
    	-remove_noise yes \
    	-remove_silence yes \
    	-bestpath yes \
    	-lw 6.500000 \
    	-dict /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
    	-hmm /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -allphone				
    -allphone_ci		no		no
    -alpha			0.97		9.700000e-01
    -argfile				
    -ascale			20.0		2.000000e+01
    -aw			1		1
    -backtrace		no		no
    -beam			1e-48		1.000000e-48
    -bestpath		yes		yes
    -bestpathlw		9.5		9.500000e+00
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		8.0
    -compallsen		no		no
    -debug					0
    -dict					/private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    -dictcase		no		no
    -dither			no		no
    -doublebw		no		no
    -ds			1		1
    -fdict					
    -feat			1s_c_d_dd	1s_c_d_dd
    -featparams				
    -fillprob		1e-8		1.000000e-08
    -frate			100		100
    -fsg					
    -fsgusealtpron		yes		yes
    -fsgusefiller		yes		yes
    -fwdflat		yes		yes
    -fwdflatbeam		1e-64		1.000000e-64
    -fwdflatefwid		4		4
    -fwdflatlw		8.5		8.500000e+00
    -fwdflatsfwin		25		25
    -fwdflatwbeam		7e-29		7.000000e-29
    -fwdtree		yes		yes
    -hmm					/private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle
    -input_endian		little		little
    -jsgf					
    -keyphrase			2015-09-03 19:59:09.348 mathcommand[1946:550412] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    	
    -kws					
    -kws_delay		10		10
    -kws_plp		1e-1		1.000000e-01
    -kws_threshold		1		1.000000e+00
    -latsize		5000		5000
    -lda					
    -ldadim			0		0
    -lifter			0		0
    -lm					/private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
    -lmctl					
    -lmname					
    -logbase		1.0001		1.000100e+00
    -logfn					
    -logspec		no		no
    -lowerf			133.33334	1.333333e+02
    -lpbeam			1e-40		1.000000e-40
    -lponlybeam		7e-29		7.000000e-29
    -lw			6.5		6.500000e+00
    -maxhmmpf		30000		30000
    -maxwpf			-1		-1
    -mdef					
    -mean					
    -mfclogdir				
    -min_endfr		0		0
    -mixw					
    -mixwfloor		0.0000001	1.000000e-07
    -ml2015-09-03 19:59:09.351 mathcommand[1946:550412] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x17105630, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x1710cfb0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    lr					
    -mmap			yes		yes
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		40
    -nwpen			1.0		1.000000e+00
    -pbeam			1e-48		1.000000e-48
    -pip			1.0		1.000000e+00
    -pl_beam		1e-10		1.000000e-10
    -pl_pbeam		1e-10		1.000000e-10
    -pl_pip			1.0		1.000000e+00
    -pl_weight		3.0		3.000000e+00
    -pl_window		5		5
    -rawlogdir				
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -sendump				
    -senlogdir				
    -senmgau				
    -silprob		0.005		5.000000e-03
    -smoothspec		no		no
    2015-09-03 19:59:09.370 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:09.376 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:09.376 mathcommand[1946:550412] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:59:09.378 mathcommand[1946:550412] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x17355780, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x1736fdc0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x1736f9e0, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
    )>.
    
    -svspec					
    -tmat					
    -tmatfloor		0.0001		1.000000e-04
    -topn			4		4
    -topn_beam		0		0
    -toprule				
    -transform		legacy		legacy
    -unit_area		yes		yes
    -upperf			6855.4976	6.855498e+03
    -uw			1.0		1.000000e+00
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -var					
    -varfloor		0.0001		1.000000e-04
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wbeam			7e-29		7.000000e-29
    -wip			0.65		6.500000e-01
    -wlen			0.025625	2.562500e-02
    
    INFO: cmd_ln.c(703): Parsing command line:
    \
    	-nfilt 25 \
    	-lowerf 130 \
    	-upperf 6800 \
    	-feat 1s_c_d_dd \
    	-svspec 0-12/13-25/26-38 \
    	-agc none \
    	-cmn current \
    	-varnorm no \
    	-transform dct \
    	-lifter 22 \
    	-cmninit 40 
    
    Current configuration:
    [NAME]			[DEFLT]		[VALUE]
    -agc			none		none
    -agcthresh		2.0		2.000000e+00
    -alpha			0.97		9.700000e-01
    -ceplen			13		13
    -cmn			current		current
    -cmninit		8.0		40
    -dither			no		no
    -doublebw		no		no
    -feat			1s_c_d_dd	1s_c_d_dd
    -frate			100		100
    -input_endian		little		little
    -lda					
    -ldadim			0		0
    -lifter			0		22
    -logspec		no		no
    -lowerf			133.33334	1.300000e+02
    -ncep			13		13
    -nfft			512		512
    -nfilt			40		25
    -remove_dc		no		no
    -remove_noise		yes		yes
    -remove_silence		yes		yes
    -round_filters		yes		yes
    -samprate		16000		1.600000e+04
    -seed			-1		-1
    -smoothspec		no		no
    -svspec					0-12/13-25/26-38
    -transform		legacy		dct
    -unit_area		yes		yes
    -upperf			6855.4976	6.800000e+03
    -vad_postspeech		50		10
    -vad_prespeech		20		10
    -vad_startspeech	10		10
    -vad_threshold		2.0		2.500000e+00
    -varnorm		no		no
    -verbose		no		no
    -warp_params				
    -warp_type		inverse_linear	inverse_linear
    -wlen			0.025625	2.562500e-02
    
    INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/feat.params
    INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
    INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
    INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
    INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
    INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/mdef
    INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
    INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
    INFO: acmod.c(124): Attempting to use PTM computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
    INFO: acmod.c(126): Attempting to use semi-continuous computation module
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/means
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/variances
    INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(294):  512x13
    INFO: ms_gauden.c(354): 0 variance values floored
    INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/sendump
    INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
    INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
    INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
    INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
    INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
    INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
    INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
    INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
    INFO: dict.c(336): 119 words read
    INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/7C3E2A94-599D-4656-8118-845829DE22A0/mathcommand.app/AcousticModelEnglish.bundle/noisedict
    INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
    INFO: dict.c(361): 9 words read
    INFO: dict2pid.c(396): Building PID tables for dictionary
    INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
    INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
    INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
    INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
    INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
    INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
    INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
    INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
    INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
    INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
    INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
    INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
    INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
    INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
    INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
    INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(186): Creating search tree
    INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
    INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
    INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
    INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
    2015-09-03 19:59:09.494 mathcommand[1946:550467] Restoring SmartCMN value of 61.386963
    2015-09-03 19:59:09.494 mathcommand[1946:550467] Listening.
    2015-09-03 19:59:09.494 mathcommand[1946:550412] Pocketsphinx is now listening.
    2015-09-03 19:59:09.495 mathcommand[1946:550467] Project has these words or phrases in its dictionary:
    0
    1
    10
    100
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2
    20
    200
    21
    22
    23
    24
    25
    26
    27
    28
    29
    3
    30
    300
    31
    32
    33
    ...and 89 more.
    2015-09-03 19:59:09.496 mathcommand[1946:550467] Recognition loop has started
    2015-09-03 19:59:09.496 mathcommand[1946:550412] Pocketsphinx is starting up.
    [PocketSphinx] Start Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    LoadingScreen: OnStartListening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Avg mic level: 0.02034019
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:09.876 mathcommand[1946:550467] Speech detected...
    2015-09-03 19:59:09.877 mathcommand[1946:550412] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:09.957 mathcommand[1946:550467] End of speech detected...
    2015-09-03 19:59:09.958 mathcommand[1946:550412] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 61.39  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 34.49 -4.88 -6.26 -3.08 -4.07  2.59  0.39 -2.54 -3.75  0.42 -2.32  4.43  7.48 >
    INFO: ngram_search_fwdtree.c(1553):      124 words recognized (7/fr)
    INFO: ngram_search_fwdtree.c(1555):     1982 senones evaluated (117/fr)
    INFO: ngram_search_fwdtree.c(1559):      837 channels searched (49/fr), 234 1st, 388 last
    INFO: ngram_search_fwdtree.c(1562):      217 words for which last channels evaluated (12/fr)
    INFO: ngram_search_fwdtree.c(1564):       33 candidate words for entering last phone (1/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.08 CPU 0.451 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.26 wall 1.542 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 2 words
    INFO: ngram_search_fwdflat.c(948):      102 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):      282 senones evaluated (17/fr)
    INFO: ngram_search_fwdflat.c(952):      120 channels searched (7/fr)
    INFO: ngram_search_fwdflat.c(954):      120 words searched (7/fr)
    INFO: ngram_search_fwdflat.c(957):       32 word transitions (1/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.004 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.008 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.9
    INFO: ngram_search.c(1306): Eliminated 4 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 62 nodes, 57 links
    INFO: ps_lattice.c(1380): Bestpath score: -43701
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:9:15) = -2738168
    INFO: ps_lattice.c(1441): Joint P(O,S) = -2745846 P(S|O) = -7678
    INFO: ngram_search.c(899): bestpath -0.00 CPU -0.000 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.001 xRT
    2015-09-03 19:59:09.962 mathcommand[1946:550467] Pocketsphinx heard "" with a score of (-7678) and an utterance ID of 0.
    2015-09-03 19:59:09.963 mathcommand[1946:550412] The received hypothesis is  with a score of -7678 and an ID of 0
    2015-09-03 19:59:09.963 mathcommand[1946:550412] hypothesisArray is [
      {
        "Hypothesis" : "",
        "Score" : -64789
      },
      {
        "Hypothesis" : "",
        "Score" : -809896
      },
      {
        "Hypothesis" : "",
        "Score" : -810181
      },
      {
        "Hypothesis" : "",
        "Score" : -810182
      },
      {
        "Hypothesis" : "",
        "Score" : -810191
      }
    ]
    2015-09-03 19:59:09.963 mathcommand[1946:550412] hypothesisArray is ,,,,
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Recognition callback: ,,,,
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.0003070831 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:10.996 mathcommand[1946:550467] Speech detected...
    2015-09-03 19:59:11.003 mathcommand[1946:550412] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:11.629 mathcommand[1946:550467] End of speech detected...
    2015-09-03 19:59:11.630 mathcommand[1946:550412] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 34.49 -4.88 -6.26 -3.08 -4.07  2.59  0.39 -2.54 -3.75  0.42 -2.32  4.43  7.48 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 45.38 -14.57  6.95 -4.36  8.85 -3.31 -8.71 -1.83 -0.98  1.65  1.61 -3.04  8.77 >
    INFO: ngram_search_fwdtree.c(1553):      556 words recognized (9/fr)
    INFO: ngram_search_fwdtree.c(1555):    13300 senones evaluated (215/fr)
    INFO: ngram_search_fwdtree.c(1559):     6655 channels searched (107/fr), 994 1st, 3660 last
    INFO: ngram_search_fwdtree.c(1562):      843 words for which last channels evaluated (13/fr)
    INFO: ngram_search_fwdtree.c(1564):      176 candidate words for entering last phone (2/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.76 CPU 1.233 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 1.67 wall 2.698 xRT
    INFO: ngram_sSpeech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    earch_fwdflat.c(302): Utterance vocabulary contains 6 words
    INFO: ngram_search_fwdflat.c(948):      457 words recognized (7/fr)
    INFO: ngram_search_fwdflat.c(950):    10472 senones evaluated (169/fr)
    INFO: ngram_search_fwdflat.c(952):     6284 channels searched (101/fr)
    INFO: ngram_search_fwdflat.c(954):      810 words searched (13/fr)
    INFO: ngram_search_fwdflat.c(957):      214 word transitions (3/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.03 CPU 0.045 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.02 wall 0.037 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.57
    INFO: ngram_search.c(1306): Eliminated 2 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 142 nodes, 664 links
    INFO: ps_lattice.c(1380): Bestpath score: -9164
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:57:60) = -495307
    INFO: ps_lattice.c(1441): Joint P(O,S) = -543007 P(S|O) = -47700
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.004 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.004 xRT
    2015-09-03 19:59:11.661 mathcommand[1946:550467] Pocketsphinx heard "6" with a score of (-47700) and an utterance ID of 1.
    2015-09-03 19:59:11.662 mathcommand[1946:550412] The received hypothesis is 6 with a score of -47700 and an ID of 1
    2015-09-03 19:59:11.663 mathcommand[1946:550412] hypothesisArray is [
      {
        "Hypothesis" : "6",
        "Score" : -30252
      },
      {
        "Hypothesis" : "60",
        "Score" : -30634
      },
      {
        "Hypothesis" : "6 A",
        "Score" : -30805
      },
      {
        "Hypothesis" : "6 A",
        "Score" : -475843
      },
      {
        "Hypothesis" : "6",
        "Score" : -516564
      }
    ]
    2015-09-03 19:59:11.665 mathcommand[1946:550412] hypothesisArray is 6,60,6 A,6 A,6
    Recognition callback: 6,60,6 A,6 A,6
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.03123856 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:11.886 mathcommand[1946:550466] Speech detected...
    2015-09-03 19:59:11.888 mathcommand[1946:550412] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:12.134 mathcommand[1946:550499] End of speech detected...
    INFO: cmn_prior.c(131): cmn_prior_update: from < 45.38 -14.57  6.95 -4.36  8.85 -3.31 -8.71 -1.83 -0.98  1.65  1.61 -3.04  8.77 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 48.02 -7.62  5.36 -4.48  4.11 -2.13 -13.69 -4.08 -2.78  6.67  2.98 -3.46  7.38 >
    2015-09-03 19:59:12.137 mathcommand[1946:550412] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: ngram_search_fwdtree.c(1553):      424 words recognized (14/fr)
    INFO: ngram_search_fwdtree.c(1555):     7605 senones evaluated (245/fr)
    INFO: ngram_search_fwdtree.c(1559):     4330 channels searched (139/fr), 486 1st, 2371 last
    INFO: ngram_search_fwdtree.c(1562):      540 words for which last channels evaluated (17/fr)
    INFO: ngram_search_fwdtree.c(1564):      224 candidate words for entering last phone (7/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.24 CPU 0.766 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.48 wall 1.534 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 12 words
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ngram_search_fwdflat.c(948):      364 words recognized (12/fr)
    INFO: ngram_search_fwdflat.c(950):     5126 senones evaluated (165/fr)
    INFO: ngram_search_fwdflat.c(952):     3642 channels searched (117/fr)
    INFO: ngram_search_fwdflat.c(954):      543 words searched (17/fr)
    INFO: ngram_search_fwdflat.c(957):      346 word transitions (11/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.01 CPU 0.030 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.039 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.27
    INFO: ngram_search.c(1306): Eliminated 3 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 88 nodes, 315 links
    INFO: ps_lattice.c(1380): Bestpath score: -4960
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:27:29) = 1695735
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1623519 P(S|O) = -72216
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.004 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.005 xRT
    2015-09-03 19:59:12.156 mathcommand[1946:550499] Pocketsphinx heard "OH" with a score of (-72216) and an utterance ID of 2.
    2015-09-03 19:59:12.157 mathcommand[1946:550412] The received hypothesis is OH with a score of -72216 and an ID of 2
    2015-09-03 19:59:12.158 mathcommand[1946:550412] hypothesisArray is [
      {
        "Hypothesis" : "OH",
        "Score" : -26048
      },
      {
        "Hypothesis" : "O",
        "Score" : -26048
      },
      {
        "Hypothesis" : "AND A",
        "Score" : -26560
      },
      {
        "Hypothesis" : "AND A",
        "Score" : -26567
      },
      {
        "Hypothesis" : "A A",
        "Score" : -26620
      }
    ]
    2015-09-03 19:59:12.158 mathcommand[1946:550412] hypothesisArray is OH,O,AND A,AND A,A A
    Recognition callback: OH,O,AND A,AND A,A A
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.01588106 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:12.656 mathcommand[1946:550499] Speech detected...
    2015-09-03 19:59:12.657 mathcommand[1946:550412] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:12.926 mathcommand[1946:550450] End of speech detected...
    2015-09-03 19:59:12.927 mathcommand[1946:550412] Pocketsphinx has detected a second of silence, concluding an utterance.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 48.02 -7.62  5.36 -4.48  4.11 -2.13 -13.69 -4.08 -2.78  6.67  2.98 -3.46  7.38 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 48.44 -5.43  3.96 -2.42  2.69 -1.73 -10.45 -4.21 -2.87  4.92  2.71 -2.47  4.16 >
    INFO: ngram_search_fwdtree.c(1553):      542 words recognized (14/fr)
    INFO: ngram_search_fwdtree.c(1555):    11210 senones evaluated (280/fr)
    INFO: ngram_search_fwdtree.c(1559):     6032 channels searched (150/fr), 648 1st, 2970 last
    INFO: ngram_search_fwdtree.c(1562):      669 words for which last channels evaluated (16/fr)
    INFO: ngram_search_fwdtree.c(1564):      333 candidate words for entering last phone (8/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.38 CPU 0.956 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 0.77 wall 1.925 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 11 words
    Speech end
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    INFO: ngram_search_fwdflat.c(948):      440 words recognized (11/fr)
    INFO: ngram_search_fwdflat.c(950):     4333 senones evaluated (108/fr)
    INFO: ngram_search_fwdflat.c(952):     2334 channels searched (58/fr)
    INFO: ngram_search_fwdflat.c(954):      651 words searched (16/fr)
    INFO: ngram_search_fwdflat.c(957):      400 word transitions (10/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.02 CPU 0.041 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.01 wall 0.033 xRT
    INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.9
    INFO: ngram_search.c(1306): Eliminated 2 nodes before end node
    INFO: ngram_search.c(1411): Lattice has 147 nodes, 64 links
    INFO: ps_lattice.c(1380): Bestpath score: -2174
    INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:9:38) = 1608254
    INFO: ps_lattice.c(1441): Joint P(O,S) = 1550968 P(S|O) = -57286
    INFO: ngram_search.c(899): bestpath 0.00 CPU 0.002 xRT
    INFO: ngram_search.c(902): bestpath 0.00 wall 0.001 xRT
    2015-09-03 19:59:12.943 mathcommand[1946:550450] Pocketsphinx heard "A" with a score of (-57286) and an utterance ID of 3.
    2015-09-03 19:59:12.944 mathcommand[1946:550412] The received hypothesis is A with a score of -57286 and an ID of 3
    2015-09-03 19:59:12.944 mathcommand[1946:550412] hypothesisArray is [
      {
        "Hypothesis" : "A",
        "Score" : -23262
      },
      {
        "Hypothesis" : "E",
        "Score" : -23418
      },
      {
        "Hypothesis" : "I",
        "Score" : -23434
      },
      {
        "Hypothesis" : "A",
        "Score" : -23448
      },
      {
        "Hypothesis" : "",
        "Score" : -65174
      }
    ]
    2015-09-03 19:59:12.945 mathcommand[1946:550412] hypothesisArray is A,E,I,A,
    Recognition callback: A,E,I,A,
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Speech recognition processing time: 0.01597881 seconds.
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:13.158 mathcommand[1946:550450] Speech detected...
    2015-09-03 19:59:13.159 mathcommand[1946:550412] Pocketsphinx has detected speech.
    Speech detected
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:13.563 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonNewDeviceAvailable
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
          - channelName: Headset Microphone
            - owningPortUID: Wired Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000476
    - inputGain: 0.763158
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:13.567 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:13.568 mathcommand[1946:550412] A new device is available
    2015-09-03 19:59:13.568 mathcommand[1946:550412] The audio input is available
    2015-09-03 19:59:13.569 mathcommand[1946:550466] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-09-03 19:59:13.570 mathcommand[1946:550412] This is a case for performing a route change. Before the route change, the current route was HeadphonesMicrophoneWired. Performing route change.
    2015-09-03 19:59:13.571 mathcommand[1946:550412] Audio route change. The new audio route is HeadphonesMicrophoneWired
    2015-09-03 19:59:13.571 mathcommand[1946:550412] Stopping listening.
    2015-09-03 19:59:14.983 mathcommand[1946:550412] 19:59:14.983 ERROR:     [0x37a9f9dc] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
    2015-09-03 19:59:14.984 mathcommand[1946:550412] Error: couldn't set session inactive.: '!act'
    2015-09-03 19:59:14.993 mathcommand[1946:550412] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
    2015-09-03 19:59:14.994 mathcommand[1946:550412] Unable to stop listening because because an utterance is still in progress; trying again.
    2015-09-03 19:59:15.046 mathcommand[1946:550412] Attempting to stop an unstopped utterance so listening can stop.
    INFO: cmn_prior.c(131): cmn_prior_update: from < 48.44 -5.43  3.96 -2.42  2.69 -1.73 -10.45 -4.21 -2.87  4.92  2.71 -2.47  4.16 >
    INFO: cmn_prior.c(149): cmn_prior_update: to   < 48.94 -4.07  3.40 -1.80  2.25 -1.33 -9.64 -3.67 -2.50  4.72  2.54 -1.85  3.88 >
    INFO: ngram_search_fwdtree.c(1553):      129 words recognized (7/fr)
    INFO: ngram_search_fwdtree.c(1555):     2615 senones evaluated (145/fr)
    INFO: ngram_search_fwdtree.c(1559):     1072 channels searched (59/fr), 252 1st, 451 last
    INFO: ngram_search_fwdtree.c(1562):      235 words for which last channels evaluated (13/fr)
    INFO: ngram_search_fwdtree.c(1564):       62 candidate words for entering last phone (3/fr)
    INFO: ngram_search_fwdtree.c(1567): fwdtree 0.32 CPU 1.765 xRT
    INFO: ngram_search_fwdtree.c(1570): fwdtree 2.11 wall 11.701 xRT
    INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 2 words
    INFO: ngram_search_fwdflat.c(948):      111 words recognized (6/fr)
    INFO: ngram_search_fwdflat.c(950):      303 senones evaluated (17/fr)
    INFO: ngram_search_fwdflat.c(952):      129 channels searched (7/fr)
    INFO: ngram_search_fwdflat.c(954):      129 words searched (7/fr)
    INFO: ngram_search_fwdflat.c(957):       34 word transitions (1/fr)
    INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.003 xRT
    INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.015 xRT
    INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 1.78 CPU 1.091 xRT
    INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 5.29 wall 3.243 xRT
    INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.05 CPU 0.034 xRT
    INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.05 wall 0.032 xRT
    INFO: ngram_search.c(307): TOTAL bestpath 0.00 CPU 0.003 xRT
    INFO: ngram_search.c(310): TOTAL bestpath 0.00 wall 0.003 xRT
    2015-09-03 19:59:15.058 mathcommand[1946:550412] No longer listening.
    2015-09-03 19:59:15.059 mathcommand[1946:550467] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-09-03 19:59:15.061 mathcommand[1946:550412] Pocketsphinx has stopped listening.
    2015-09-03 19:59:15.094 mathcommand[1946:550412] 19:59:15.094 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:15.095 mathcommand[1946:550412] 19:59:15.095 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:15.101 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.128000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:15.102 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:15.103 mathcommand[1946:550412] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:59:15.105 mathcommand[1946:550412] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Headphones---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x1742a2a0, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x17431810, type = MicrophoneWired; name = Headset Microphone; UID = Wired Microphone; selectedDataSource = (null)>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x17431120, type = Headphones; name = Headphones; UID = Wired Headphones; selectedDataSource = (null)>"
    )>.
    [PocketSphinx] Stop Listening
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didFailToLoadRewardedVideo: Internal at location Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    2015-09-03 19:59:15.745 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneWired
        - portType: Headset Microphone
        - UID: Wired Microphone
        - portType: Headset Microphone
        - channels:
          - channelName: Headset Microphone
            - owningPortUID: Wired Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Headphones
        - portType: Headphones
        - UID: Wired Headphones
        - portType: Headphones
        - channels:
          - channelName: Headphones Left
            - owningPortUID: Wired Headphones
            - channelNumber: 1
            - channelLabel: 4294967295
          - channelName: Headphones Right
            - owningPortUID: Wired Headphones
            - channelNumber: 2
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.000476
    - inputGain: 0.763158
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 2
    - outputNumberOfChannels: 2
    - outputVolume: 0.375000
    - outputLatency: 0.001633
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:15.746 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:15.746 mathcommand[1946:550412] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
    2015-09-03 19:59:15.748 mathcommand[1946:550412] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---HeadphonesMicrophoneWired---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x173a2420, 
    inputs = (null); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x173b4db0, type = Headphones; name = Headphones; UID = Wired Headphones; selectedDataSource = (null)>"
    )>.
    2015-09-03 19:59:19.025 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonOldDeviceUnavailable
    Dumping AVAudioSession settings:
    - availableInputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
    - category: AVAudioSessionCategoryPlayAndRecord
    - categoryOptions: 13
    - currentRoute.inputs:
      - portName: MicrophoneBuiltIn
        - portType: iPhone Microphone
        - UID: Built-In Microphone
        - portType: iPhone Microphone
        - channels:
          - channelName: iPhone Microphone
            - owningPortUID: Built-In Microphone
            - channelNumber: 1
            - channelLabel: 4294967295
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - inputDataSource.dataSourceID: 1835216945
    - inputDataSource.dataSourceName: Bottom
    - inputDataSource.orientation: Bottom
    - inputDataSource.location: Lower
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.092880
    - inputLatency: 0.012494
    - inputGain: 0.368421
    - inputGainSettable: 1
    - maximumInputNumberOfChannels: 1
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013515
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:19.034 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:19.034 mathcommand[1946:550412] An old device became unavailable
    2015-09-03 19:59:19.034 mathcommand[1946:550412] The audio input has become unavailable
    2015-09-03 19:59:19.034 mathcommand[1946:550412] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.
    2015-09-03 19:59:19.035 mathcommand[1946:550412] the audio input is now unavailable.
    2015-09-03 19:59:19.036 mathcommand[1946:550412] This is a case for performing a route change. Before the route change, the current route was SpeakerMicrophoneBuiltIn. Performing route change.
    2015-09-03 19:59:19.038 mathcommand[1946:550412] Audio route change. The new audio route is SpeakerMicrophoneBuiltIn
    2015-09-03 19:59:19.038 mathcommand[1946:550412] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.
    2015-09-03 19:59:19.042 mathcommand[1946:550467] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    Chartboost: didCacheInterstitial: Game Over
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    Chartboost: didCacheInterstitial: Main Menu
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    /// will call StopListening() here
    
    2015-09-03 19:59:30.753 mathcommand[1946:550412] [PocketSphinx] Stop Listening
    2015-09-03 19:59:30.754 mathcommand[1946:550557] [[OEPocketsphinxController sharedInstance] stopListening] was called while listening was not in progress. This is not necessarily an exception, just a notification that that a request to stop a listening session was ignored because there was no active listening session to stop.
    [AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
     
    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)
    
    /// will call StartListening() here
    
    2015-09-03 19:59:41.689 mathcommand[1946:550412] [PocketSphinx] Start Recording
    2015-09-03 19:59:41.689 mathcommand[1946:550556] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:
    2015-09-03 19:59:41.696 mathcommand[1946:550412] 19:59:41.696 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:41.696 mathcommand[1946:550412] 19:59:41.696 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
    2015-09-03 19:59:41.699 mathcommand[1946:550412] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
    Dumping AVAudioSession settings:
    - availableInputs:
    - category: AVAudioSessionCategoryAmbient
    - categoryOptions: 1
    - currentRoute.inputs:
    - currentRoute.outputs:
      - portName: Speaker
        - portType: Speaker
        - UID: Speaker
        - portType: Speaker
        - channels:
          - channelName: Speaker
            - owningPortUID: Speaker
            - channelNumber: 1
            - channelLabel: 4294967295
    - inputAvailable: 1
    - mode: AVAudioSessionModeDefault
    - IOBufferDuration: 0.023220
    - inputLatency: 0.000000
    - inputGain: 1.000000
    - inputGainSettable: 0
    - maximumInputNumberOfChannels: 0
    - maximumOutputNumberOfChannels: 1
    - outputNumberOfChannels: 1
    - outputVolume: 0.437500
    - outputLatency: 0.013356
    - otherAudioPlaying: 0
    - preferredIOBufferDuration: 0.000000
    - preferredInputNumberOfChannels: 0
    - preferredOutputNumberOfChannels: 0
    - preferredSampleRate: 44100.000000
    - recordPermission: 1735552628
    - sampleRate: 44100.000000
    - secondaryAudioShouldBeSilencedHint: 0
    - shouldGroupAccessibilityChildren: 0
    2015-09-03 19:59:41.699 mathcommand[1946:550412] Audio route has changed for the following reason:
    2015-09-03 19:59:41.699 mathcommand[1946:550412] There was a category change. The new category is AVAudioSessionCategoryAmbient
    2015-09-03 19:59:41.701 mathcommand[1946:550412] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Speaker---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x17071570, 
    inputs = (
        "<AVAudioSessionPortDescription: 0x17436650, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
    ); 
    outputs = (
        "<AVAudioSessionPortDescription: 0x172a5fd0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
    )>.
    

    Would it be possible that Unity is also reacting to the route change, and thus causing the race condition that causes OEPocketSphinxController to become locked?

    #1026710
    Halle Winkler
    Politepix

    Hi,

    If the method you are using to dump the audio session settings reports that the sample app is using 44.1k after listening has started and before it has stopped in the OpenEars sample app, that means one of four options: either the session reading method is unreliable, it is reading a different value than the actual current sample rate of the audio input, it is reading an input device with idiosyncratic settings which hasn’t been discussed here yet, or the statement that it is happening in an unmodified OpenEars sample app is inaccurate in some way. 44.1k is neither a default value for the mobile device (that is 48k) or the value that OpenEars is using (that is 16k). The session dumps can’t be used as a basis for more troubleshooting until that is clarified.

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