diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index bdc3e601..ed9448c8 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -807,22 +807,6 @@ static wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name) return NULL; } -static int attrnumber(const wchar_t *pw, int default_value, int type) -{ - int value = 0; - - if ((pw == NULL) || !IsDigit09(*pw)) - return default_value; - - while (IsDigit09(*pw)) - value = value*10 + *pw++ - '0'; - if ((type == 1) && (ucd_tolower(*pw) == 's')) { - // time: seconds rather than ms - value *= 1000; - } - return value; -} - static int attrcopy_utf8(char *buf, const wchar_t *pw, int len) { // Convert attribute string into utf8, write to buf, and return its utf8 length diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index b2851a7a..a69a0e54 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -47,6 +47,7 @@ int attrcmp(const wchar_t *string1, const char *string2); int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab); +int attrnumber(const wchar_t *pw, int default_value, int type); int attrcmp(const wchar_t *string1, const char *string2) { @@ -74,3 +75,19 @@ int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab) return mtab[ix].value; } +int attrnumber(const wchar_t *pw, int default_value, int type) +{ + int value = 0; + + if ((pw == NULL) || !IsDigit09(*pw)) + return default_value; + + while (IsDigit09(*pw)) + value = value*10 + *pw++ - '0'; + if ((type == 1) && (ucd_tolower(*pw) == 's')) { + // time: seconds rather than ms + value *= 1000; + } + return value; +} +