码迷,mamicode.com
首页 > 移动开发 > 详细

ios 将文本转化成语音

时间:2015-03-20 16:30:18      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:objective-c   ios   

啥都不说:

直接上代码

   AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"你好我使用台语发音跟你说话。"];
    //台语发音
    AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-TW"];
    utterance.voice = voice;
    utterance.volume = 1.0;
    utterance.rate= 0.2;  //设置语速
    utterance.pitchMultiplier= 1.1;
    NSLog(@"%@",[AVSpeechSynthesisVoice speechVoices]);
    AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc]init];
    [synth speakUtterance:utterance];


ios 将文本转化成语音

标签:objective-c   ios   

原文地址:http://blog.csdn.net/hitourlee/article/details/44492011

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!