Voice Output in iOS

2020-03-25 07:54发布

Is it possible to access the speech synthesis feature of the iOS that is used for accessibility?

3条回答
老娘就宠你
2楼-- · 2020-03-25 08:30

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

查看更多
劳资没心,怎么记你
3楼-- · 2020-03-25 08:35

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]);
查看更多
冷血范
4楼-- · 2020-03-25 08:42

Now, since ios7 you can use the built in AVSpeechSynthesizer

查看更多
登录 后发表回答