Search code examples
javatext-to-speechibm-watson

Handling multiple queries with ibm watson text to speech service


I am working with ibm watson tts API but thing is that when i synthesize multiples sentences(one after another) there is a slight delay in between outputs but I would like it to be continuous (as if the seperate sentences were being said in one utterance). Is there anyway to do this? Or are there any other tts solutions that can help me with this?

This is the method that synthesizes the different utterances using the API :

public void sayUtterances() {
    String[] splitUtterance = {"this is", "the sentence I would",
                               "like to say in one utterance", "without pausing"};

    for(int i = 0; i < splitUtterance.length; i++) {
        textToSpeechService.synthesize(splitUtterance[i], Voice.EN_ALLISON);
    }
}

Solution

  • Call the service in parallel and asynchronously. You don't need to wait for the response for the 1st sentence before invoking the service for the 2nd sentence.