I am new to iOS development. I want to perform a simple text to speech conversion within app. Following is my code:
AVSpeechSynthesizer *speechSynthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Test text to speech conversion"];
[utterance setRate:1.1f];
[speechSynthesizer speakUtterance:utterance];
The above code is not giving me any exception but its not working at all. I've tried multiple APIs given on GitHub but nothing worked for me. Could anybody tell me where I might be going wrong? Do I have to make any settings on device?
Problem sorted..!! Actually the problem was, I had "USE SIDE SWITCH TO:" option in the Settings->General set to "Mute". I set that option to "Lock Rotation" and got rid of my problem. I found a related post here discussions.apple.com/thread/5366534