Using iOS7's Text To Speech to Make iOS Speak

iOS
2013-09-30 22:40 (11 years ago) ytyng
  • Lo-Fi.
  • Can also play in Japanese.
  • Japanese is slightly distorted.

The AVFoundation framework is required

#import <AVFoundation/AVFoundation.h>

AVSpeechUtterance *utterance = [AVSpeechUtterance
                              speechUtteranceWithString:@"The quick brown fox"];
// Language, defaults to iOS settings if omitted
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = 0.2;
utterance.volume = 0.8;

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

Comments

Archive

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011