[Freeswitch-svn] [commit] r3915 - freeswitch/trunk/src/mod/say/mod_say_en

Freeswitch SVN mikej at freeswitch.org
Fri Jan 5 21:53:11 EST 2007


Author: mikej
Date: Fri Jan  5 21:53:11 2007
New Revision: 3915

Modified:
   freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c

Log:
fix issues with speaking 1 or 0 amounts in time measurement
add fixes from mmurdock via irc, thanks mike


Modified: freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c
==============================================================================
--- freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c	(original)
+++ freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c	Fri Jan  5 21:53:11 2007
@@ -291,13 +291,16 @@
 			if ((p = strrchr(tme, ':'))) {
 				*p++ = '\0';
 				seconds = atoi(p);
-				if ((p = strrchr(tme, ':'))) {
+				if ((p = strchr(tme, ':'))) {
 					*p++ = '\0';
 					minutes = atoi(p);
 					if (tme) {
 						hours = atoi(tme);
 					}
 				}
+                else {
+                     minutes = atoi(tme);
+                }
 			}
 		} else {
 			if ((seconds = atoi(tosay)) <= 0) {
@@ -319,18 +322,45 @@
 
 		if (hours) {
 			say_num(hours, SSM_PRONOUNCED);
-			say_file("digits/hours.wav");
+            if (hours == 1) {
+                say_file("digits/hour.wav");  //TODO -- NEED TO GET "hour.wav" recorded
+            }
+            else {
+                say_file("digits/hours.wav");
+            }
 		}
+        else {
+            say_file("digits/0.wav");
+            say_file("digits/hours.wav");
+        }
 
 		if (minutes) {
 			say_num(minutes, SSM_PRONOUNCED);
-			say_file("digits/minutes.wav");
+            if (minutes == 1) {
+                say_file("digits/minute.wav");
+            }
+            else {
+                say_file("digits/minutes.wav");
+            }
 		}
+        else {
+            say_file("digits/0.wav");
+            say_file("digits/minutes.wav");
+        }
 
 		if (seconds) {
 			say_num(seconds, SSM_PRONOUNCED);
-			say_file("digits/seconds.wav");
+            if (seconds == 1) {
+                say_file("digits/second.wav");
+            }
+            else {
+                say_file("digits/seconds.wav");
+            }
 		}
+        else {
+            say_file("digits/0.wav");
+            say_file("digits/seconds.wav");
+        }
 
 		return SWITCH_STATUS_SUCCESS;
 	}
@@ -419,6 +449,9 @@
 
 	if ((cents = strchr(sbuf, '.'))) {
 		*cents++ = '\0';
+        if (strlen(cents) > 2) {
+            cents[2] = '\0';
+        }
 	}
 
     /* If positive sign - skip over" */



More information about the Freeswitch-svn mailing list