Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unfinished speakOut() will be interrupt by another call and never gets the 'tts-end' callback #4

Open
jammind opened this issue Aug 5, 2021 · 0 comments

Comments

@jammind
Copy link

jammind commented Aug 5, 2021

I fixed it by replacing Line 46
let language = options && options.language ? options.language : 'en-US' // Line 46
with the following codes

    if (typeof Speech.__currentSpeakOutSuccess == 'function') {
        success('tts-end')
        return
    }
    Speech.__currentSpeakOutSuccess = onMessage
    exec(onMessage, error, SPEECH, API_LIST.SPEAK_OUT, [message, pitchRate, speechRate, language])

    function onMessage (msg) {
        if (msg == 'tts-end') delete Speech.__currentSpeakOutSuccess
        success(msg)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant