Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 342c3292 authored by Charles Chen's avatar Charles Chen
Browse files

Fixing the random audio mangling problem (TTS becomes incomprehensibly fast)

parent 4b897aa9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@ static tts_callback_status ttsSynthDoneCB(void *& userdata, uint32_t rate,
        if (bufferSize > 0) {
            prepAudioTrack(pJniData, pForAfter->streamType, rate, format, channel);
            if (pJniData->mAudioOut) {
                pJniData->mAudioOut->start();
                pJniData->mAudioOut->write(wav, bufferSize);
                memset(wav, 0, bufferSize);
                //LOGV("AudioTrack wrote: %d bytes", bufferSize);
@@ -549,7 +550,6 @@ android_tts_SynthProxy_speak(JNIEnv *env, jobject thiz, jint jniData,

    if (pSynthData->mAudioOut) {
        pSynthData->mAudioOut->stop();
        pSynthData->mAudioOut->start();
    }

    afterSynthData_t* pForAfter = new (afterSynthData_t);