[espeak-ng:master] reported: Missing mark reporting after sentence end #github


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By sthibaul:

there is something wrong in line 23: espeak_SetSynthCallback(callback); Looks like it was meant to call function in line 5

? No. The whole purpose of espeak_SetSynthCallback is to provide to espeak-ng a function to call whenever an event happens.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By rhdunn:

Looking at the code I don't see anything obviously wrong with the processing of markers: 1. mark is handled by ProcessSsmlTag in sssml.c line 792. That is adding an embedded control 'M' into the text stream. 1. TranslateClause in translate.c line 2161 is handling the CTRL_EMBEDDED character in the text stream and calling EmbeddedCommand, which is reading the data from the command and setting the various state variables like embedded_list; line 2477 is setting FLAG_EMBEDDED if there were any embedded commands processed. 1. The SFLAG_EMBEDDED flag is set by TranslateWord2 if FLAG_EMBEDDED is set for the current word. 1. The Gemerate/MbrolaTranslate functions call DoEmbedded if the current phoneme has SFLAG_EMBEDDED set. 1. The DoEmbedded function in synthesize.c line 1111 is calling DoMarker, specifying espeakEVENT_MARK. 1. DoMarker in synthesize.c line 1023 is adding the command to the wcmdq list. 1. WavegenFill2 in wavegen.c line 1337 is handling WCMD_MARKER by calling MarkerEvent. 1. MarkerEvent in speech.c is constructing an event of the given type (espeakEVENT_MARK).

The speech.c file handles the synthesis callback. The callback is manually called there when my_mode is 0 (i.e. when the program is handling the audio).

There is a comment in event.h that says "- When the timeout happens, the synth_callback is called." but I can't see where that is happening.

Provided that the test program works correctly with espeak, it should be possible to run a git bisect on the code to locate when the callback stopped working (presumably only for the case where espeak/espeak-ng is processing the audio, or maybe in combination with the event logic).


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By sthibaul:

I also tried 1.46.06, with the same result.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By jaacoppi:

I don't know about markers and I didn't test your attached code. I'm just replying SSML support in general.

The sentence detecting with SSML has known problems. Issues #737 and #410 might be relevant for this case.

I've been trying to simplify the SSML code but it's difficult. So far I've identified these possible problems: - It's parsing a character at a time, and sometimes eating up characters already in the buffer on purpose. Maybe a character like a marker or sentence terminator gets lost by accident. - The SSML stack with voice information isn't kept in sync with sentence ends (perhaps not relevant in this case)

Try the markers mid sentence and with sentences with periods, commas, exclamation and question marks. If you get it working then the problems is with sentence detection instead of markers.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By sthibaul:

With this example:

espeak-mark.c.txt

char *s = "<speak> Hello <mark name=\"1\"/>, <mark name=\"2\"/> world. <mark name=\"3\"/>Does <mark name=\"4\"/> this<mark name=\"5\"/>? And <mark name=\"6\"/> that<mark name=\"7\"/>! <mark name=\"8\"/> And <mark name=\"9\"/> hello again.<mark name=\"10\"/></speak>";

Only mark 3 is missing, i.e. only after the period.


espeak-ng@groups.io Integration <espeak-ng@...>
 

[espeak-ng:master] New Comment on Issue #920 Missing mark reporting after sentence end
By jaacoppi:

I think this confirms that the bug is with SSML sentence terminator handling, not with markers.

My guesses: - ReadClause() is returning a wrong value (int terminator). - The character buffer where the marker is stored is overwritten and never reaches TranslateClause()