Android 使用TTS SDK出现3个错误

newsay 25 信誉分
2024-04-15T06:20:31.1733333+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());

  }

Looking forward to your reply, thank you
Microsoft Q&A
Microsoft Q&A
使用此标记与 Microsoft 问答团队共享建议、功能请求和 bug。 Microsoft 问答团队将定期评估你的反馈,并在此过程中提供更新。
45 个问题
0 个注释 无注释
{count} 票