3

我没有任何美国开发者朋友可以与之测试,但我意识到我确实知道整个社区都有帮助。:)

所以我的问题是——美国的 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"听起来也不错。

4

3 回答 3

8

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

en-gb -> 带有英国口音的男声

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

en-us -> 没有口音的女性声音(好的 - 带有美国口音 ;-)

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

于 2013-10-06T11:21:26.993 回答
6

把它放在你的代码中某个地方运行一次以转储所有可用的语言。不幸的是,它没有给出性别细节。

NSArray* speechVoices = [AVSpeechSynthesisVoice speechVoices];
NSLog(@"Voices: (%d) %@", speechVoices.count, speechVoices);
于 2014-01-07T15:15:12.230 回答
1

您可以使用 [AVSpeechSynthesisVoice speechVoices] 确定哪些声音可用。这将返回大量语言,包括(以及 Mac 上的等效语音):en-AU - Karen en-GB - Daniel en-IE - Moira en-US - Samantha en-ZA - Tessa

我最喜欢的是莫伊拉

我看不出有任何理由说明美国版的声音会减少。事实上,它可能至少还有一个,因为在美国,Siri 可以选择男性和女性的声音——男性的声音听起来像是来自 Mac 的 Alex,但似乎没有任何方法可以以编程方式访问它。

于 2013-10-20T15:19:28.363 回答