| return short_pause; | return short_pause; | ||||
| } | } | ||||
| wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name) | |||||
| { | |||||
| // Gets the value string for an attribute. | |||||
| // Returns NULL if the attribute is not present | |||||
| int ix; | |||||
| static wchar_t empty[1] = { 0 }; | |||||
| while (*pw != 0) { | |||||
| if (iswspace(pw[-1])) { | |||||
| ix = 0; | |||||
| while (*pw == name[ix]) { | |||||
| pw++; | |||||
| ix++; | |||||
| } | |||||
| if (name[ix] == 0) { | |||||
| // found the attribute, now get the value | |||||
| while (iswspace(*pw)) pw++; | |||||
| if (*pw == '=') pw++; | |||||
| while (iswspace(*pw)) pw++; | |||||
| if ((*pw == '"') || (*pw == '\'')) // allow single-quotes ? | |||||
| return pw+1; | |||||
| else | |||||
| return empty; | |||||
| } | |||||
| } | |||||
| pw++; | |||||
| } | |||||
| return NULL; | |||||
| } | |||||
| static int AddNameData(const char *name, int wide) | static int AddNameData(const char *name, int wide) | ||||
| { | { | ||||
| // Add the name to the namedata and return its position | // Add the name to the namedata and return its position |
| ProcessParamStack(outbuf, outix, *n_param_stack, param_stack, speech_parameters); | ProcessParamStack(outbuf, outix, *n_param_stack, param_stack, speech_parameters); | ||||
| } | } | ||||
| wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name) | |||||
| { | |||||
| // Gets the value string for an attribute. | |||||
| // Returns NULL if the attribute is not present | |||||
| int ix; | |||||
| static wchar_t empty[1] = { 0 }; | |||||
| while (*pw != 0) { | |||||
| if (iswspace(pw[-1])) { | |||||
| ix = 0; | |||||
| while (*pw == name[ix]) { | |||||
| pw++; | |||||
| ix++; | |||||
| } | |||||
| if (name[ix] == 0) { | |||||
| // found the attribute, now get the value | |||||
| while (iswspace(*pw)) pw++; | |||||
| if (*pw == '=') pw++; | |||||
| while (iswspace(*pw)) pw++; | |||||
| if ((*pw == '"') || (*pw == '\'')) // allow single-quotes ? | |||||
| return pw+1; | |||||
| else | |||||
| return empty; | |||||
| } | |||||
| } | |||||
| pw++; | |||||
| } | |||||
| return NULL; | |||||
| } | |||||
| int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab); | int attrlookup(const wchar_t *string1, const MNEM_TAB *mtab); | ||||
| int attrnumber(const wchar_t *pw, int default_value, int type); | int attrnumber(const wchar_t *pw, int default_value, int type); | ||||
| int attr_prosody_value(int param_type, const wchar_t *pw, int *value_out); | int attr_prosody_value(int param_type, const wchar_t *pw, int *value_out); | ||||
| wchar_t *GetSsmlAttribute(wchar_t *pw, const char *name); | |||||
| int GetVoiceAttributes(wchar_t *pw, int tag_type, SSML_STACK *ssml_sp, SSML_STACK *ssml_stack, int n_ssml_stack, char current_voice_id[40], espeak_VOICE *base_voice, char base_voice_variant_name[40]); | int GetVoiceAttributes(wchar_t *pw, int tag_type, SSML_STACK *ssml_sp, SSML_STACK *ssml_stack, int n_ssml_stack, char current_voice_id[40], espeak_VOICE *base_voice, char base_voice_variant_name[40]); | ||||
| void ProcessParamStack(char *outbuf, int *outix, int n_param_stack, PARAM_STACK *param_stack, int *speech_parameters); | void ProcessParamStack(char *outbuf, int *outix, int n_param_stack, PARAM_STACK *param_stack, int *speech_parameters); | ||||
| PARAM_STACK *PushParamStack(int tag_type, int *n_param_stack, PARAM_STACK *param_stack); | PARAM_STACK *PushParamStack(int tag_type, int *n_param_stack, PARAM_STACK *param_stack); |