Reputation: 43
Everytime I use AVSpeechSynthesizer to speak text Instruments reports a memory leak in the AXSpeechImplementation library. Here's the code I'm using to make the call:
AVSpeechUtterance *speak = [AVSpeechUtterance speechUtteranceWithString:text];
speak.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
speak.rate = AVSpeechUtteranceMaximumSpeechRate * .2;
[m_speechSynth speakUtterance:speak];
Here's the link to the Instruments screenshot http://imageshack.com/a/img690/7993/b9w5.png
Upvotes: 3
Views: 1158
Reputation: 51
I solved this by declaring the AVSpeechSynthesizer as a global variable
static let synth = AVSpeechSynthesizer()
Upvotes: 3
Reputation: 4516
For what it is worth - yes, I see exactly the same 16byte leak on every utterance from the speech synthesizer. So either it is a leak in Apple's code or we are both making the same error somewhere!
Ali
Upvotes: 7