Reputation: 21
I am using AVSpeechSynthesizer
for text-to-speech in my iOS app.
The speech synthesizer is working fine on all devices except from iPad 2 (model A1395) running iOS 9.0.2. I am using Xcode 7.0.1.
The problem is, on playing a text say “hope” the letter “p” is either really quiet or not playing that the user can hear only “ho”. If the text is “hopes” then it plays correct.
Any idea on how to solve this?
Upvotes: 2
Views: 574
Reputation: 6012
There is some parameters (voice, rate...) that needs to be set and I've already encountered some bug with iOS 9 with some code that was working directly with previous iOS. Here is my code for initializing AVSpeechSynthesizer
:
NSString*str = @"hope";
AVSpeechSynthesizer* synth = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *utterance = [AVSpeechUtterance
speechUtteranceWithString: str];
utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
NSString*lang = @"en-US"
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:lang];
[synth speakUtterance:utterance];
Can you try this code on your iPad 2 for example ?
Upvotes: 1