Initial support for SSML phoneme tags.

This commit is contained in:
Reece H. Dunn
2015-11-28 13:57:56 +00:00
parent 7214b4abfa
commit 9826e9cc30
+19
View File
@@ -1,6 +1,7 @@
/***************************************************************************
* Copyright (C) 2005 to 2015 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* Copyright (C) 2015 by Reece H. Dunn *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -1789,6 +1790,10 @@ static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outb
PARAM_STACK *sp;
SSML_STACK *ssml_sp;
static const MNEM_TAB mnem_phoneme_alphabet[] = {
{"espeak",1},
{NULL, -1}};
static const MNEM_TAB mnem_punct[] = {
{"none", 1},
{"all", 2},
@@ -1938,6 +1943,20 @@ static int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outb
PopParamStack(tag_type, outbuf, outix);
break;
case SSML_PHONEME:
attr1 = GetSsmlAttribute(px,"alphabet");
attr2 = GetSsmlAttribute(px,"ph");
value = attrlookup(attr1,mnem_phoneme_alphabet);
if (value == 1) // alphabet="espeak"
{
outbuf[(*outix)++] = '[';
outbuf[(*outix)++] = '[';
*outix += attrcopy_utf8(&outbuf[*outix],attr2,n_outbuf-*outix);
outbuf[(*outix)++] = ']';
outbuf[(*outix)++] = ']';
}
break;
case SSML_SAYAS:
attr1 = GetSsmlAttribute(px,"interpret-as");
attr2 = GetSsmlAttribute(px,"format");