Closed chandansaibdb closed 4 years ago
I think there is a browser 36k word limit or something like that. I advise you split the text into smaller chunks and play them one after another. The promise based API of speak-tts will allow you to do it easily.
Thank you for the quick response, but my text count is less than 200.
This is my code: My response contains the text that I want to speak. where do i have to change? it stops for words less than 200 also. what i have observed is it stops after reading for 15 seconds. const speech = new Speech();
speech
.speak({
text: response,
//queue: false,
listeners: {
onstart: () => {
console.log("Start utterance");
},
onend: () => {
console.log("End utterance");
},
onresume: () => {
console.log("Resume utterance");
},
onboundary: event => {
console.log(
event.name +
" boundary reached after " +
event.elapsedTime +
" milliseconds."
);
}
}
})
.then(() => {
console.log("Success !");
})
.catch(e => {
console.error("An error occurred :", e);
});
Hello. Awaiting for your response.!
Have you tried directly with the speech Synthesis API ? if you experience the same issue, it means this is an API bug (something I can't fix), if not it means the issue comes from the library.
Can u give me example? How to use
You can try your long text with this and see if it works or not: https://codepen.io/matt-west/pen/wGzuJ
No it is not working . it breaks in middle. it hardly spoke for 15 seconds and less than 200 characters.
Well then it's not a library issue. You'd have to split the text yourself and send shorter texts one after another.
Hey, you had suggested me to break my long text into chunks. how do i do that?
i wanted to get a speech response from my chatbot, i am able to get speech for the response i get. but when the response is longer, it stops all of a sudden, any idea how to fix this issue?