An Azure service that integrates speech processing into apps and services.
SPXSpeechSynthesizer stopSpeaking() method cannot return immediately on iOS 17
Sam Yu
5
Reputation points
After calling SPXSpeechSynthesizer startSpeakingSsml() to synthesize the speech, while the speech is playing back, and then call stopSpeaking() to stop the speech, stopSpeaking() cannot return immediately on iOS 17. The speech audio can be stopped immediately, but this method will take 10-20 secs to return.
iOS16 and iOS 15 doesn't have this issue.
Below is our sample swift code to illustrate this issue on iOS 17
// below is the code snippet to start text to speech
let speechConfig = try SPXSpeechConfiguration(subscription: key, region: region)
synthesizer = try SPXSpeechSynthesizer(speechConfig)
let ssml = """
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xml:lang="en-US">
<voice name="en-US-JennyNeural">
<mstts:express-as style="friendly">
<prosody rate="1.0">
Hello how are you ?
</prosody>
</mstts:express-as>
</voice>
</speak>
"""
try synthesizer?.startSpeakingSsml(ssml)
Below is the code snippet to stop text to speech
try synthesizer?.stopSpeaking() // this method takes 10-20s to return
We're using MicrosoftCognitiveServicesSpeech-iOS ver 1.32.1
Azure Speech in Foundry Tools
Azure Speech in Foundry Tools
Sign in to answer