Android uses TTS SDK and 3 errors occur

newsay 25 Reputation points
2024-04-16T01:53:41.8933333+00:00

Hello, our App Android version has used Microsoft's TTS SDK

"com.microsoft.cognitiveservices.speech:client-sdk:1.34.0"

But 3 errors appear frequently:

Error 1:

{CancellationReason:Error ErrorCode: ServiceTimeout ErrorDetails:USP error: timeout waiting for the first audio chunk. }

Can I set this timeout myself? Or what do I need to do to avoid this error?

Error 2:

{Timeout while synthesizing. Current RTF: 24.304 (threshold 2), frame interval 3038ms (threshold 3000ms). USP state: ReceivingData. Received audio size: 6000 bytes.}

What is this RTF? Can I set its value myself? (threshold 3000ms) How to make this 3000ms value larger?

Error 3:

When I use the TTS SDK, audio playback often freezes. What do I need to do to resolve this behavior?

Here's how I use TTS:

AudioDataStream stream = AudioDataStream.fromResult(result);

AudioTrack audioTrack = new AudioTrack();

byte[] buffer = new byte[2048];

 while (!stopped) {
   long len = stream.readData(buffer);

   audioTrack.write(buffer, 0, Long.valueOf(len).intValue());

  }



Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,398 questions
{count} votes

2 answers

Sort by: Most helpful
  1. newsay 25 Reputation points
    2024-04-23T02:18:19.42+00:00

    "One previous issue reported for Error no. 2 was due to the pricing tier of the resource."

    I didn't understand the meaning of this sentence. We are already paying users, and we have a pay-as-you-go model.

    "the free tier and the standard tier"

    What does "tier" specifically mean?


  2. newsay 25 Reputation points
    2024-04-23T08:51:03.37+00:00

    Android tts SDK version:

    implementation "com.microsoft.cognitiveservices.speech:client-sdk:1.34.0"

    ——————

    Error synthesizing. Result ID: 24c25e70c2c142daaa8d2ad563d7efae. Error detail:CancellationReason:Error ErrorCode: ServiceTimeout ErrorDetails:Timeout while synthesizing. Current RTF: 11.7019 (threshold 2), frame interval 3048ms (threshold 3000ms). USP state: ReceivingData .Received audio size: 12766 bytes.

    ——————

    This is our log about error 2. We look forward to your reply again, thank you.

    2024-04-23-TTS-error-log.txt

    0 comments No comments