gpt4 book ai didi

iphone - 美国 iPhone 是否具有 AVSpeechSynthesizer 的英国语音? (要测试的示例代码)

转载 作者:可可西里 更新时间:2023-11-01 06:18:57 24 4
gpt4 key购买 nike

我没有任何美国开发人员 friend 可以测试这个,但我意识到我确实认识整个社区的乐于助人的人。 :)

所以我的问题是 - 美国 iPhone 是否有 AVSpeechSynthesizer 的英国语音,或者它是否像模拟器一样播放单调的无人机?

下面是测试代码:

#import <AVFoundation/AVFoundation.h>

AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init];
AVSpeechUtterance *speechUtterance = [AVSpeechUtterance speechUtteranceWithString:@"This is something really special that a speech system could read out. You might find that I'm talking with quite an intelligent english accent. I hope I don't just sound robotic."];
speechUtterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-gb"];
speechUtterance.rate = 0.20;

[synthesizer speakUtterance:speechUtterance];

一方面,它支持所有语言是有道理的。另一方面,我知道文本转语音的声音有多大,所以只包含母语也是有意义的,而在美国可能不包含英国语音。

根据我自己的测试,将语言更改为诸如 @"en-au"(适用于澳大利亚)之类的语言在我的设备上听起来也不错。

最佳答案

在 iPad mini 上尝试了 3 个 voiceWithLanguage 设置:

zh-cn -> 带有英语口音的男声

en-au -> 带有澳大利亚口音的女声

zh-cn -> 没有口音的女声(OK - 有美国口音 ;-)

第 5 代 iPod touch 上的结果相同。

关于iphone - 美国 iPhone 是否具有 AVSpeechSynthesizer 的英国语音? (要测试的示例代码),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19207973/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com