chrome.tts.speak character limit chrome.tts.speak character limit google-chrome google-chrome

chrome.tts.speak character limit


I have read official documentations and how you reported it is written that:

The maximum length of the text is 32,768 characters.

Maybe they refer to SSML file max length!

I used chrome api for a while and I can say to you that:

  • The breaking of the utterances only happens when the voice is not a native voice,
  • The cutting out usually occurs between 200-300 characters,When it does break you can un-freeze it by doing speechSynthesis.cancel();
  • The 'onend' event sometimes decides not to fire. A quirky work-around to this is to console.log() out the utterance object before speaking it. Also I found wrapping the speak invocation in a setTimeout callback helps smooth these issues out.

I resolved the problem splitting text:

  • Firstly in sentences (trying non to split them and maintain prosody);
  • If the first step is not sufficient split the sentence again in sub-sentences;

So I suggest to fix the problem this way.