提交 0b3cafcf authored 作者: Jeff Lenk's avatar Jeff Lenk

FS-5275 -resolve

上级 ca73adbe
...@@ -106,13 +106,25 @@ static switch_status_t play_group(switch_say_method_t method, switch_say_gender_ ...@@ -106,13 +106,25 @@ static switch_status_t play_group(switch_say_method_t method, switch_say_gender_
say_file("currency/and.wav"); say_file("currency/and.wav");
} }
if (method == SSM_COUNTED) { if (method == SSM_COUNTED) {
if ( gender == SSG_MASCULINE ) {
say_file("digits/h-%d0_m.wav", b);
} else if ( gender == SSG_NEUTER ) {
say_file("digits/h-%d0_n.wav", b);
} else {
say_file("digits/h-%d0.wav", b); say_file("digits/h-%d0.wav", b);
}
} else { } else {
say_file("digits/%d0.wav", b); say_file("digits/%d0.wav", b);
} }
} else { } else {
if (method == SSM_COUNTED) { if (method == SSM_COUNTED) {
say_file("digits/h-%d%d.wav", b, c); if ( gender == SSG_MASCULINE ) {
say_file("digits/h-%d%d_m.wav", b,c);
} else if ( gender == SSG_NEUTER ) {
say_file("digits/h-%d%d_n.wav", b,c);
} else {
say_file("digits/h-%d%d.wav", b,c);
}
} else { } else {
say_file("digits/%d%d.wav", b, c); say_file("digits/%d%d.wav", b, c);
} }
...@@ -122,12 +134,18 @@ static switch_status_t play_group(switch_say_method_t method, switch_say_gender_ ...@@ -122,12 +134,18 @@ static switch_status_t play_group(switch_say_method_t method, switch_say_gender_
if (c) { if (c) {
if (method == SSM_COUNTED) { if (method == SSM_COUNTED) {
if ( gender == SSG_MASCULINE ) {
say_file("digits/h-%d_m.wav", c);
} else if ( gender == SSG_NEUTER ) {
say_file("digits/h-%d_n.wav", c);
} else {
say_file("digits/h-%d.wav", c); say_file("digits/h-%d.wav", c);
}
} else { } else {
/*"one" used as an article is feminine or masculine in german, e.g. voicemail-message is feminine /*"one" used as an article is feminine or masculine in german, e.g. voicemail-message is feminine
only applies to the likes of 1, 101, 1001 etc.*/ only applies to the likes of 1, 101, 1001 etc.*/
if ( b == 0 && c == 1 && gender == SSG_FEMININE ) { if ( b == 0 && c == 1 && gender == SSG_FEMININE ) {
say_file("digits/%d_f.wav", c); say_file("digits/1_f.wav");
} else if ( b == 0 && c == 1 && what ) { } else if ( b == 0 && c == 1 && what ) {
say_file("digits/s-1.wav"); say_file("digits/s-1.wav");
} else { } else {
...@@ -251,10 +269,11 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -251,10 +269,11 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
} }
if (hours) { if (hours) {
say_num(hours, SSM_PRONOUNCED);
if (hours == 1) { if (hours == 1) {
say_file("digits/1_f.wav");
say_file("time/hour.wav"); say_file("time/hour.wav");
} else { } else {
say_num(hours, SSM_PRONOUNCED);
say_file("time/hours.wav"); say_file("time/hours.wav");
} }
} else { } else {
...@@ -263,10 +282,11 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -263,10 +282,11 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
} }
if (minutes) { if (minutes) {
say_num(minutes, SSM_PRONOUNCED);
if (minutes == 1) { if (minutes == 1) {
say_file("digits/1_f.wav");
say_file("time/minute.wav"); say_file("time/minute.wav");
} else { } else {
say_num(minutes, SSM_PRONOUNCED);
say_file("time/minutes.wav"); say_file("time/minutes.wav");
} }
} else { } else {
...@@ -274,11 +294,13 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -274,11 +294,13 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
say_file("time/minutes.wav"); say_file("time/minutes.wav");
} }
say_file("currency/and.wav");
if (seconds) { if (seconds) {
say_num(seconds, SSM_PRONOUNCED);
if (seconds == 1) { if (seconds == 1) {
say_file("digits/1_f.wav");
say_file("time/second.wav"); say_file("time/second.wav");
} else { } else {
say_num(seconds, SSM_PRONOUNCED);
say_file("time/seconds.wav"); say_file("time/seconds.wav");
} }
} else { } else {
...@@ -311,6 +333,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -311,6 +333,7 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
} }
if (say_date) { if (say_date) {
say_args->gender = SSG_MASCULINE;
say_file("time/day-%d.wav", tm.tm_wday); say_file("time/day-%d.wav", tm.tm_wday);
say_num(tm.tm_mday, SSM_COUNTED); say_num(tm.tm_mday, SSM_COUNTED);
say_file("time/mon-%d.wav", tm.tm_mon); say_file("time/mon-%d.wav", tm.tm_mon);
...@@ -318,29 +341,27 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay, ...@@ -318,29 +341,27 @@ static switch_status_t de_say_time(switch_core_session_t *session, char *tosay,
} }
if (say_time) { if (say_time) {
int32_t hour = tm.tm_hour, pm = 0; if (say_date) {
say_file("time/at.wav");
if (hour > 12) {
hour -= 12;
pm = 1;
} else if (hour == 12) {
pm = 1;
} else if (hour == 0) {
hour = 12;
pm = 0;
} }
say_num(hour, SSM_PRONOUNCED); if (tm.tm_hour == 1) {
say_file("digits/s-1.wav");
} else {
say_num(tm.tm_hour, SSM_PRONOUNCED);
}
say_file("time/oclock.wav"); say_file("time/oclock.wav");
if (tm.tm_min > 9) { if (tm.tm_min > 0) {
say_num(tm.tm_min, SSM_PRONOUNCED); say_file("currency/and.wav");
} else if (tm.tm_min) { if (tm.tm_min == 1) {
say_file("time/oh.wav"); say_file("digits/1_f.wav")
say_file("time/minute.wav");
} else {
say_num(tm.tm_min, SSM_PRONOUNCED); say_num(tm.tm_min, SSM_PRONOUNCED);
say_file("time/minutes.wav");
}
} }
say_file("time/%s.wav", pm ? "p-m" : "a-m");
} }
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -378,23 +399,25 @@ static switch_status_t de_say_money(switch_core_session_t *session, char *tosay, ...@@ -378,23 +399,25 @@ static switch_status_t de_say_money(switch_core_session_t *session, char *tosay,
dollars++; dollars++;
} }
/* Say dollar amount */ /* Say dollar amount */
de_say_general_count(session, dollars, say_args, args);
if (atoi(dollars) == 1) { if (atoi(dollars) == 1) {
say_file("digits/s-1.wav");
say_file("currency/dollar.wav"); say_file("currency/dollar.wav");
} else { } else {
de_say_general_count(session, dollars, say_args, args);
say_file("currency/dollars.wav"); say_file("currency/dollars.wav");
} }
/* Say "and" */
say_file("currency/and.wav");
/* Say cents */ /* Say cents */
if (cents) { if (cents) {
de_say_general_count(session, cents, say_args, args); /* Say "and" */
say_file("currency/and.wav");
if (atoi(cents) == 1) { if (atoi(cents) == 1) {
say_file("digits/s-1.wav");
say_file("currency/cent.wav"); say_file("currency/cent.wav");
} else { } else {
de_say_general_count(session, cents, say_args, args);
say_file("currency/cents.wav"); say_file("currency/cents.wav");
} }
} else { } else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论