mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Initial support for SSML phoneme tags.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user