Skip to content

Commit

Permalink
Ignore client SSML mode for anything but TEXT messages
Browse files Browse the repository at this point in the history
SSML doesn't make sense for anything else, and it can break processing
of other messages in some cases.

For example, if a symbol expansion leads to converting it to a TEXT
command, it then has to be valid SSML (including surrounding <speak>
tags), otherwise a module might not accept it.  If the client is not in
SSML mode it worked fine as the input was translated to SSML, but if
the client was in that mode the input was still assumed to already be
SSML, although it actually wasn't as it's not possible (nor makes
sense) to send SSML for e.g. CHAR or KEY.

This e.g. broke the Baratinoo module for such symbol expansions (e.g.
when "y" is getting translated to "igrèque" to workaround pronunciation
issues in some synthesizers).
  • Loading branch information
cwendling authored and sthibaul committed Jul 31, 2024
1 parent aaa1e21 commit 0e802dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ queue_message(TSpeechDMessage * new, int fd, int history_flag,
new->time = time(NULL);

new->settings.paused_while_speaking = 0;

/* Ignore possible SSML mode for anything but TEXT, as it doesn't make
* sense anything else and can cause problems if the message processing
* assumes SSML although it isn't */
if (type != SPD_MSGTYPE_TEXT)
new->settings.ssml_mode = SPD_DATA_TEXT;
}
id = new->id;

Expand Down

0 comments on commit 0e802dc

Please sign in to comment.