您的位置:首页 > 其它

文字的发音

2016-02-15 20:20 435 查看
AVSpeechSynthesizer *reader = [[AVSpeechSynthesizer
alloc]init];

AVSpeechUtterance *utterance = [AVSpeechUtterance
speechUtteranceWithString:self.wenZiLabel.text];
AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice
voiceWithLanguage:@"zh-TW"];
utterance.voice = voice;
[reader speakUtterance:utterance];

需要导入的库

AVFoundation.framework

#import <AVFoundation/AVSpeechSynthesis.h>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: