[Freeswitch-svn] [commit] r9019 - freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx

Freeswitch SVN brian at freeswitch.org
Mon Jul 14 14:05:27 EDT 2008


Author: brian
Date: Mon Jul 14 14:05:27 2008
New Revision: 9019

Modified:
   freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c

Log:
don't feed ps_process_raw if we are trying to grab the results.. it causes it to freak out

Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c	Mon Jul 14 14:05:27 2008
@@ -261,10 +261,13 @@
 	if (switch_test_flag(ah, SWITCH_ASR_FLAG_CLOSED)) return SWITCH_STATUS_BREAK; 
 	
 	if (!switch_test_flag(ps, PSFLAG_HAS_TEXT) && switch_test_flag(ps, PSFLAG_READY)) {
-
-		switch_mutex_lock(ps->flag_mutex);
-		rv = ps_process_raw(ps->ps, (int16 *)data, len / 2 , FALSE, FALSE);
-		switch_mutex_unlock(ps->flag_mutex);
+		/* only feed ps_process_raw when we are listening */
+		if (ps->listening) {
+			switch_mutex_lock(ps->flag_mutex);
+			printf(".");
+			rv = ps_process_raw(ps->ps, (int16 *)data, len / 2 , FALSE, FALSE);
+			switch_mutex_unlock(ps->flag_mutex);
+		}
 
 		if (rv < 0) {
 			return SWITCH_STATUS_FALSE;



More information about the Freeswitch-svn mailing list