diff --git a/Makefile.am b/Makefile.am index 28c39f87..97817f4a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -167,6 +167,7 @@ src_libespeak_ng_la_SOURCES = \ src/libespeak-ng/setlengths.c \ src/libespeak-ng/spect.c \ src/libespeak-ng/speech.c \ + src/libespeak-ng/ssml.c \ src/libespeak-ng/synthdata.c \ src/libespeak-ng/synthesize.c \ src/libespeak-ng/synth_mbrola.c \ diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 5e2e8587..bdc3e601 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -807,31 +807,6 @@ static wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name) return NULL; } -static int attrcmp(const wchar_t *string1, const char *string2) -{ - int ix; - - if (string1 == NULL) - return 1; - - for (ix = 0; (string1[ix] == string2[ix]) && (string1[ix] != 0); ix++) - ; - if (((string1[ix] == '"') || (string1[ix] == '\'')) && (string2[ix] == 0)) - return 0; - return 1; -} - -static int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab) -{ - int ix; - - for (ix = 0; mtab[ix].mnem != NULL; ix++) { - if (attrcmp(string1, mtab[ix].mnem) == 0) - return mtab[ix].value; - } - return mtab[ix].value; -} - static int attrnumber(const wchar_t *pw, int default_value, int type) { int value = 0; diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c new file mode 100644 index 00000000..b2851a7a --- /dev/null +++ b/src/libespeak-ng/ssml.c @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2005 to 2015 by Jonathan Duddington + * email: jonsd@users.sourceforge.net + * Copyright (C) 2015-2017 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see: . + */ + + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + +#include "error.h" +#include "speech.h" +#include "phoneme.h" +#include "voice.h" +#include "synthesize.h" +#include "translate.h" + +int attrcmp(const wchar_t *string1, const char *string2); +int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab); + +int attrcmp(const wchar_t *string1, const char *string2) +{ + int ix; + + if (string1 == NULL) + return 1; + + for (ix = 0; (string1[ix] == string2[ix]) && (string1[ix] != 0); ix++) + ; + if (((string1[ix] == '"') || (string1[ix] == '\'')) && (string2[ix] == 0)) + return 0; + return 1; +} + + +int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab) +{ + int ix; + + for (ix = 0; mtab[ix].mnem != NULL; ix++) { + if (attrcmp(string1, mtab[ix].mnem) == 0) + return mtab[ix].value; + } + return mtab[ix].value; +} +