Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 16 - SPXSpeechSynthesizer error #1613

Closed
danigutierrezayuso opened this issue Aug 9, 2022 · 13 comments
Closed

iOS 16 - SPXSpeechSynthesizer error #1613

danigutierrezayuso opened this issue Aug 9, 2022 · 13 comments
Assignees
Labels
accepted Issue moved to product team backlog. Will be closed when addressed. bug Something isn't working pending close Closed soon without new activity text-to-speech Text-to-Speech

Comments

@danigutierrezayuso
Copy link

When using the speech synthesizer 'speakSsml' function on iOS 16 an error is returned:

[AudioConverter] CompositeAudioConverter.cpp:1082 kAudio_ParamError: packet description 1 of 2: range 5662468096-5662468098, 576 data bytes

We are using the latest 1.23 version of the framework.

This was working fine on iOS 15 and now it's returning 0 bytes of audio.

@ralph-msft
Copy link

In order to be able to debug this issue, could you please share the following:

  • The SDK logs. You can find instructions on how to enable logging here: https://docs.microsoft.com/azure/cognitive-services/speech-service/how-to-use-logging#ios
  • The minimum code that reproduces your issue. In particular this should include the configuration you are using with the speech synthesizer (speech output formats, sample input to reproduce the issue, etc..). Please make sure you do --not-- include any subscription keys or auth tokens in your code

@ralph-msft ralph-msft added the in-review In review label Aug 9, 2022
@danigutierrezayuso
Copy link
Author

danigutierrezayuso commented Aug 10, 2022

Hi Ralph,

Here is the log
swift.log

I guess the key is the error in this line:

[960550]: 16351ms SPX_TRACE_ERROR: synthesizer.cpp:289 ExecuteSynthesis: Codec decoding error: Error decoding audio stream, error code: -50

And this is the configuration that we are using:

let filePath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).map(\.path)[0]
let fileName = "/wavefile.wav"
let fileAtPath = filePath + fileName
if !FileManager.default.fileExists(atPath: fileAtPath) {
        FileManager.default.createFile(atPath: fileAtPath, contents: nil, attributes: nil)
}
try! audioConfig = SPXAudioConfiguration(wavFileOutput: fileAtPath)
try! speechConfig = SPXSpeechConfiguration(authorizationToken: azureToken, region: "westeurope")
let synthetizer = try! SPXSpeechSynthesizer(speechConfiguration: speechConfig, audioConfiguration: audioConfig)
let result = try! synthetizer.speakSsml(ssml)

Thank you for helping us!

@ralph-msft
Copy link

Thanks for the additional information, we are investigating this issue and will post an update here once we have more information

@yulin-li
Copy link
Contributor

Looks the issue is from audio decoding. The SDK would automatically use the compressed audio format (mp3) when requesting service and decode it using Apple's API to pcm formats. As it broken on iOS 16, there might be some API change in new iOS version.

We will investigate this issue further

@yulin-li yulin-li added the text-to-speech Text-to-Speech label Aug 12, 2022
@yulin-li
Copy link
Contributor

BTW, could you try to set SpeechServiceConnection_SynthEnableCompressedAudioTransmission to false to disable the compress transmission feature? see here

@yulin-li
Copy link
Contributor

Hi @danigutierrezayuso, I tried to repro this issue but failed. I installed xcode 14 beta with iOS 16 simulator on my macbook and run the quickstart and everything works well in the simulator.

Could you try the quickstart to see if you can repro?

@danigutierrezayuso
Copy link
Author

Hi @yulin-li, this is only failing on actual devices. It always works fine on the simulator.

I've tried to set speechServiceConnectionSynthesisEnableCompressedAudioTransmission to false and now it's working perfectly after that change. Thank you!

@yulin-li yulin-li self-assigned this Aug 25, 2022
@yulin-li
Copy link
Contributor

We have fixed this internally and the fix will be released with 1.24.

I'd like to keep this issue open until 1.24 released.

@yulin-li yulin-li added the bug Something isn't working label Aug 26, 2022
@pankopon pankopon added accepted Issue moved to product team backlog. Will be closed when addressed. pending close Closed soon without new activity and removed in-review In review labels Aug 31, 2022
@pankopon
Copy link
Contributor

pankopon commented Sep 1, 2022

To be closed when the Speech SDK 1.24.0 release is available (latest estimate by the end of September this year).

@tomthecarrot
Copy link

tomthecarrot commented Sep 22, 2022

We are also encountering this issue on iOS 16 devices - it results in a consistently-reproducible crash. iOS 15 devices work fine. Additionally, using an 8KHz output format (SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm) does work.

Is there an updated ETA on this? Until it is fixed, we cannot ship our update due to crashing on iOS 16.

@yulin-li
Copy link
Contributor

We are also encountering this issue on iOS 16 devices - it results in a consistently-reproducible crash. iOS 15 devices work fine. Additionally, using an 8KHz output format (SpeechSynthesisOutputFormat.Raw8Khz16BitMonoPcm) does work.

Is there an updated ETA on this? Until it is fixed, we cannot ship our update due to crashing on iOS 16.

The ETA is mid-Oct.

@yulin-li
Copy link
Contributor

Closing this issue as 1.24 is released.

@guris12
Copy link

guris12 commented Jan 31, 2023

Hi @yulin-li, this is only failing on actual devices. It always works fine on the simulator.

I've tried to set speechServiceConnectionSynthesisEnableCompressedAudioTransmission to false and now it's working perfectly after that change. Thank you!

how can we set this variable to false ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue moved to product team backlog. Will be closed when addressed. bug Something isn't working pending close Closed soon without new activity text-to-speech Text-to-Speech
Projects
None yet
Development

No branches or pull requests

6 participants