Readspeaker starts speaking twice

664 Views Asked by At

We have implemented the Readspeaker (http://www.readspeaker.com/) in our project. It works well on a few things: in Safari on my Macbook and Chrome on my iPad, the first words of a text are spoken two times. For example:

The quick brown fox jumps over the lazy dog. The Readspeaker says: The quick brown.. the quick brown fox jumps over the lazy dog.

The implemations seems to be good. The Javascript files are loaded and the connection with Readspeaker does exists.

What could be the problem?

1

There are 1 best solutions below

1
Richard Risholm On BEST ANSWER

I'm Richard, I work as a developer for ReadSpeaker.

The problem and where it comes from can depend on what product you are trying to implement. I will assume that you are implementing the Enterprise Highlighting 2.5 product since you mention that all scripts are loaded.

This kind of issue is caused by the way that the browser requests the audio data. In Safari on a Mac the browser will first make an HTTP request towards the server, requesting content with a length of 0-1, that is, it requests some data to verify that the file exists. The server will respond that the file does indeed exist and it will give a Content-length header to indicate how much data there is.
After this it makes a request to the server to fetch the audio data, but this time requesting data between 0-XX bytes, where XX is the amount of length that the client received in the Content-length header back from the server.
If an error occurs during the transfer however, the client may make another request towards the server to get the audio data, but this time it will request content between YY-XX bytes.
However, if the request is made towards the TTS-server, the TTS-server will generate the audio as the request comes in (it does not occur when the audio is cached). When it streams content it will therefore not know how long the actual content is before it starts streaming.
The result is that even though the client requested content between YY-XX bytes, the server will respond with content from 0-XX bytes.

The result is that when the audio object is being filled up with streamed data, the client believes it is receiving data between XX-YY bytes, whilst it instead is being filled from 0-YY bytes. The visible (or hearable) result is that the beginning of the text is read twice.

This is an issue that we have already solved on our servers (didn't see your post until now) and it should be working correctly now. If you are still experiencing problems please contact the ReadSpeaker support team and include your customerID, URL to a page where the issue can be reproduced as well as browser details (version etc) and they will be happy to help you!

Best regards,
Richard Risholm
Developer, Technical Sales engineer and Project Manager for ReadSpeaker.