@@ -73,6 +73,7 @@ static SSML_STACK ssml_stack[N_SSML_STACK];
7373
7474static espeak_VOICE base_voice ;
7575static char base_voice_variant_name [40 ] = { 0 };
76+ static char current_voice_id [40 ] = { 0 };
7677
7778static int n_param_stack ;
7879PARAM_STACK param_stack [N_PARAM_STACK ];
@@ -509,6 +510,7 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_
509510 tr -> clause_upper_count = 0 ;
510511 tr -> clause_lower_count = 0 ;
511512 * tone_type = 0 ;
513+ * voice_change = 0 ;
512514
513515 if (ungot_char2 != 0 ) {
514516 c2 = ungot_char2 ;
@@ -606,11 +608,14 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_
606608 xml_buf [n_xml_buf ] = 0 ;
607609 c2 = ' ' ;
608610
609- terminator = ProcessSsmlTag (xml_buf , buf , & ix , n_buf , xmlbase , & audio_text , voice_change , & base_voice , base_voice_variant_name , & ignore_text , & clear_skipping_text , & sayas_mode , & sayas_start , ssml_stack , & n_ssml_stack , & n_param_stack , (int * )speech_parameters );
611+ terminator = ProcessSsmlTag (xml_buf , buf , & ix , n_buf , xmlbase , & audio_text , current_voice_id , & base_voice , base_voice_variant_name , & ignore_text , & clear_skipping_text , & sayas_mode , & sayas_start , ssml_stack , & n_ssml_stack , & n_param_stack , (int * )speech_parameters );
610612
611613 if (terminator != 0 ) {
612614 buf [ix ] = ' ' ;
613615 buf [ix ++ ] = 0 ;
616+
617+ if (terminator & CLAUSE_TYPE_VOICE_CHANGE )
618+ strcpy (voice_change , current_voice_id );
614619 return terminator ;
615620 }
616621 c1 = ' ' ;
@@ -1000,6 +1005,9 @@ void InitText2(void)
10001005
10011006 option_punctuation = speech_parameters [espeakPUNCTUATION ];
10021007 option_capitals = speech_parameters [espeakCAPITALS ];
1008+
1009+ current_voice_id [0 ] = 0 ;
1010+
10031011 ignore_text = false;
10041012 audio_text = false;
10051013 clear_skipping_text = false;
0 commit comments