Saturday, May 10, 2014

AVSpeechSynthesizer in iOS

One of the new APIs introduced with iOS 7 is the new speech synthesizer in the AVFoundation framework. It went relatively unnoticed among the flood of more significant changes in iOS 7.
#import <AVFoundation/AVFoundation.h>



AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Hello World!"];
    utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
    utterance.rate = 0.70*AVSpeechUtteranceDefaultSpeechRate;

    AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
    [synth speakUtterance:utterance];

1 comment:

  1. Hello, an amazing Information dude. Thanks for sharing this nice information with us. Covid-19 Cleaning Services Collingdale

    ReplyDelete