I've had some success by moving the synthesizer out as a global property.
var synthesizer = AVSpeechSynthesizer()
class TextToSpeechPlayer: NSObject {
//private var synthesizer = AVSpeechSynthesizer()
override init() {
super.init()
prepareAudioSession()
synthesizer.delegate = self
}
deinit {
disableAudioSession()
}
Topic:
Media Technologies
SubTopic:
Audio
Tags: