iOS version is using Microsoft TTS SDK occurs an error

newsay 25 Reputation points
2024-04-16T02:08:01.0066667+00:00

Hello, our iOS version is using Microsoft TTS SDK, the version is: pod 'MicrosoftCognitiveServicesSpeech-iOS', '~> 1.35.0'

When calling the official demo, an error occurred, specifically:

func synthesisToSpeaker() {

     var speechConfig: SPXSpeechConfiguration?

     do {

         try speechConfig = SPXSpeechConfiguration(subscription: sub, region: region)

     } catch {

         print("error \(error) happened")

         speechConfig = nil

     }

     let synthesizer = try! SPXSpeechSynthesizer(speechConfig!)

     if inputText.isEmpty {

         return

     }

     let result = try! synthesizer.speakText(inputText)

     if result.reason == SPXResultReason.canceled

     {

         let cancellationDetails = try! SPXSpeechSynthesisCancellationDetails(fromCanceledSynthesisResult: result)

         print("cancelled, detail: \(cancellationDetails.errorDetails!) ")

     }

 }

Error: Codec decoding is not started within 2s.

Please tell me how to solve this problem. Looking forward to your reply, thank you

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

1 answer

Sort by: Most helpful
  1. navba-MSFT 17,120 Reputation points Microsoft Employee
    2024-04-16T03:16:38.12+00:00

    @newsay Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    The issue has been posted in the below GitHub channel. This issue is still being investigated. There is no fix available yet, however the workaround shared here should help:

    https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/2150#issuecomment-2045227515

    Workaround:

    Please disable the compressed audio transmission feature by setting SpeechServiceConnection_SynthEnableCompressedAudioTransmission property to false in speech config and check if that helps.

    speechConfig.setProperty(sdk.PropertyId.SpeechServiceConnection_SynthEnableCompressedAudioTransmission, "false");

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    0 comments No comments