Friday 13 February 2015

speaking ios iphone device ios8

#import 
-(void)speak:(NSString*)message {
    AVSpeechSynthesizer * synth = [[AVSpeechSynthesizer alloc] init];
    AVSpeechUtterance * utterance = [[AVSpeechUtterance alloc] initWithString:message];
    [utterance setRate:AVSpeechUtteranceMaximumSpeechRate *.3f];
    [utterance setVolume:1.0f];
    [utterance setPitchMultiplier:-3.0f];
    [utterance setVoice:[AVSpeechSynthesisVoice voiceWithLanguage:@"en-IE"]];
    [synth speakUtterance:utterance];
}

No comments:

Post a Comment