[asterisk-commits] trunk r19512 - in /trunk: apps/app_speech_utils.c doc/speechrec.txt

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 12 12:57:23 MST 2006


Author: file
Date: Wed Apr 12 14:57:21 2006
New Revision: 19512

URL: http://svn.digium.com/view/asterisk?rev=19512&view=rev
Log:
Add ability to see if the person calling said anything or not.

Modified:
    trunk/apps/app_speech_utils.c
    trunk/doc/speechrec.txt

Modified: trunk/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_speech_utils.c?rev=19512&r1=19511&r2=19512&view=diff
==============================================================================
--- trunk/apps/app_speech_utils.c (original)
+++ trunk/apps/app_speech_utils.c Wed Apr 12 14:57:21 2006
@@ -368,6 +368,7 @@
 				} else {
 					time(&current);
 					if ((current-start) >= timeout) {
+						pbx_builtin_setvar_helper(chan, "SILENCE", "1");
 						done = 1;
 						break;
 					}
@@ -398,6 +399,7 @@
 		case AST_SPEECH_STATE_DONE:
 			/* Assume there will be no results by default */
 			pbx_builtin_setvar_helper(chan, "RESULTS", "0");
+			pbx_builtin_setvar_helper(chan, "SILENCE", "0");
 			/* Decoding is done and over... see if we have results */
 			results = ast_speech_results_get(speech);
 			if (results != NULL) {

Modified: trunk/doc/speechrec.txt
URL: http://svn.digium.com/view/asterisk/trunk/doc/speechrec.txt?rev=19512&r1=19511&r2=19512&view=diff
==============================================================================
--- trunk/doc/speechrec.txt (original)
+++ trunk/doc/speechrec.txt Wed Apr 12 14:57:21 2006
@@ -20,7 +20,7 @@
 
 SpeechBackground(Sound File|Timeout):
 
-This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard. Once they stop talking the processing sound is played to indicate the speech recognition engine is working. Once results are available the application returns and results (score and text) are available as dialplan variables. The first text and score are ${TEXT0} AND ${SCORE0} while the second are ${TEXT1} and ${SCORE1}. This may change in the future, however, to use a dialplan function instead of dialplan variables. Note it is possible to have more then one result. The first argument is the sound file and the second is the timeout. Note the timeout will only start once the sound file has stopped playing.
+This application plays a sound file and waits for the person to speak. Once they start speaking playback of the file stops, and silence is heard. Once they stop talking the processing sound is played to indicate the speech recognition engine is working. Once results are available the application returns and results (score and text) are available as dialplan variables. The first text and score are ${TEXT0} AND ${SCORE0} while the second are ${TEXT1} and ${SCORE1}. This may change in the future, however, to use a dialplan function instead of dialplan variables. Note it is possible to have more then one result. The first argument is the sound file and the second is the timeout. Note the timeout will only start once the sound file has stopped playing. If the timeout is reached, then the variable SILENCE is set to 1 so that you will know that the person did not speak anything.
 
 SpeechDeactivateGrammar(Grammar Name):
 



More information about the asterisk-commits mailing list