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());
}