When synthesizing German-language texts containing special letters (Ä, Ö, Ü, ß, and possibly others), these letters are broken up into character salad like "A tilde quarter".
This is my code:
unsigned int spoken_message_uuid = 0;
espeak_ERROR Speak (wstring text)
{
espeak_ERROR error = EE_OK;
unsigned int *uuid = &spoken_message_uuid;
const wchar_t *input = text.c_str ();
wcout << L"Speaking text:" << endl << input << endl;
error = espeak_Synth (input, text.length (), 0, POS_CHARACTER, 0, espeakCHARS_WCHAR | espeakENDPAUSE | espeakSSML, uuid, NULL);
return error;
}
I tested the whole using this text (with SSML markup dividing the messages):
B1 Reichsstraße Burgstemmen Brückenarbeiten
<break strength="strong">
GHAL Georgi-Dimitroff-Straße Merseburger Straße Durchfahrt gesperrt für LKW
<break strength="strong">
B27 Donaueschingen/A864 wegen Baustelle gesperrt
<break strength="strong">
Holsteiner Chaussee - Oldesloer Straße wegen Baustelle gesperrt
<break strength="strong">
Rosdorf wegen Baustelle gesperrt
<break strength="strong">
B5 Herzfelde Strausberger Straße gesperrt
<break strength="strong">
L52 Anschlussstelle Laubach gesperrt
<break strength="strong">
B6 Am Leineufer Mecklenheidestraße wegen Baustelle gesperrt
<break strength="strong"></break></break></break></break></break></break></break></break>
What's wrong here? I sometimes encounter such trouble when UTF-8-encoded text is being treated as ASCII by some program.
Here is my config:
pi@autoradio:/import/valen/autoradio $ espeak --version
eSpeak NG text-to-speech: 1.49.2 Data at: /usr/lib/arm-linux-gnueabihf/espeak-ng-data
pi@autoradio:/import/valen/autoradio $ g++ --version
g++ (Raspbian 6.5.0-1+rpi1+b1) 6.5.0 20181026
The voice I'm using is mb-de5.
Please check, how it works with eSpeak NG latest version 1.50.
No use! The errors persist with ver. 1.50 from the Debian Buster backports repo. Here is the exact version:
OK, at least I've got the following workaround now: I hand the text over to espeak as a normal C character array. In fact, it turned out that the texts (I read from a database) are UTF-8-encoded, so that I don't even have to convert them into a wide string:
Nevertheless, the issue I reported still remains an unresolved bug, so that someone should look into this. Thank you.