开发者

Voice Output in iOS

开发者 https://www.devze.com 2023-01-13 06:34 出处:网络
Is it possibl开发者_运维技巧e to access the speech synthesis feature of the iOS that is used for accessibility?Here is an example using AVSpeechSynthesizer on iOS 7:

Is it possibl开发者_运维技巧e to access the speech synthesis feature of the iOS that is used for accessibility?


Here is an example using AVSpeechSynthesizer on iOS 7:

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Hey Guys"];
[synthesizer speakUtterance:utterance];

To change the voice use:

utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"de-DE"];

To get a list of all voices:

NSLog(@"voices %@", [AVSpeechSynthesisVoice speechVoices]);


May be you can find this SO question helpful. FLITE also brings speech synthesis to iOS.


Now, since ios7 you can use the built in AVSpeechSynthesizer

0

精彩评论

暂无评论...
验证码 换一张
取 消