InsuredApple
InsuredApple

Reputation: 83

Text-To-Speech Library (issue with pauses)

I've done quite a bit of snooping around the internet.

Right now I'm using the ResponsiveVoice library for which I pay ~$25/month. https://code.responsivevoice.org/responsivevoice.js

The problem is that it seems to insert long breaks into text. The text is user generated, so it is out of my control (I can't optimize the sentence structure to sound good).

I'm assuming it's a problem with ResponsieVoice. They acknowledged the issue, but say they can't do anything about it. It's how text-to-speech behaves.

Here are some examples of text that's causing issues (inserts a pause).

I'm not sure if text-to-speech has to insert random pauses, these sites seem to be able to handle text-to-speech without "strange" pauses.

I can't insert their links... because of my sucky reputation.

It could also be an implementation issue, but ResponsiveVoice support said it's normal to get these long pauses.

Here is a screenshot from the console, which shows the "break" that is causing a pause.

screenshot of console in chrome

It would be great to get some insight from you guys (who understand the technology better).

Upvotes: 0

Views: 969

Answers (1)

Jakob Hoefflin
Jakob Hoefflin

Reputation: 21

I had the exact same problem and found the cause in my case. On our site the text to read out was generated by jQuery like so:

$('#text-to-read').text().trim().replace(/(?:\r\n|\r|\n)/g, '');

The regex at the end actually created tabs and spaces. I simply had to adjust the regex:

$('#text-to-read').text().trim().replace(/\s\s+/g, ' ');

I know this is a very rare cause maybe, but it might help others out there!

Upvotes: 2

Related Questions