~alcinnz/rhapsode

48e8ad2108775cc467abf226463c6f9ac10e2209 — Adrian Cochrane 3 years ago 6df35fc
Fix secondary segfault on Arch.
1 files changed, 3 insertions(+), 2 deletions(-)

M src/main.c
M src/main.c => src/main.c +3 -2
@@ 132,12 132,13 @@ void speak(char *ssml, char *mark, char* fallback) {
}

void speak_text(char *text, espeak_PARAMETER param, int value) {
    if (param != 0) espeak_SetParameter(param, value, /* relative */1);
    int curval = param != 0 ? espeak_GetParameter(param, 0) : 0;
    if (param != 0) espeak_SetParameter(param, curval + value, /* relative */0);

    int flags = espeakCHARS_AUTO | espeakPHONEMES | espeakENDPAUSE | espeakCHARS_UTF8;
    espeak_Synth(text, strlen(text)+1, 0, POS_CHARACTER, 0, flags, NULL, NULL);

    if (param != 0) espeak_SetParameter(param, espeak_GetParameter(param, /* current */0), /* relative */0);
    if (param != 0) espeak_SetParameter(param, curval, /* relative */0);
}

/* Utilities */