1

It may be a dump question, but I'm really new to objective-C Programming.

I have the simple use case where my app should read sentences to the user. Just one after another.

I found this post and I used the following code snippet:

NSLog(@"%s", "TTS");
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Hello World"];
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
[utterance setRate:0.1f];

[synthesizer speakUtterance:utterance];

Now my problem: The log gets printed, but I hear nothing. I tried on iPhone 5 with 9.3.5 and iPhone 6 with 9.3.5, Siri works, sound is turned on.

I'm lacking of ideas want could be wrong because no error or warning is thrown. What am I missing?

Just some additional information, I'm not sure if it matters.

  • The app is a phonegap-Webapp which calls objective-c native code for iOS specific behavior using the cordova.exec() Method.
  • @property(nonatomic, readonly, getter=isSpeaking) BOOL speaking; returned false after the speakUtterance:utterance call.

Thanks in advance. I'm really out of idea after researching... I'd prefer not using a third party library.

Community
  • 1
  • 1
V.Mae
  • 11
  • 2

0 Answers0