什么是适用于iOS 7 AVSpeechSynthesisVoice的BCP-47语音代码?

时间:2013-12-15 01:26:37

标签: ios7 avfoundation voice

今天我很兴奋,iOS7中提供了语音合成功能。

我想选择男声(在OSX中默认为alex)。

我不知道他的BCP-47代码是什么,BTW如何获取所有语音代码的完整列表

3 个答案:

答案 0 :(得分:10)

iOS 8添加了希伯来语,在iOS 9或10中没有添加任何新语言:

ar-SA       Arabic      Saudi Arabia
cs-CZ       Czech       Czech Republic
da-DK       Danish      Denmark
de-DE       German      Germany
el-GR       Modern Greek        Greece
en-AU       English     Australia
en-GB       English     United Kingdom
en-IE       English     Ireland
en-US       English     United States
en-ZA       English     South Africa
es-ES       Spanish     Spain
es-MX       Spanish     Mexico
fi-FI       Finnish     Finland
fr-CA       French      Canada
fr-FR       French      France
he-IL       Hebrew      Israel
hi-IN       Hindi       India
hu-HU       Hungarian       Hungary
id-ID       Indonesian      Indonesia
it-IT       Italian     Italy
ja-JP       Japanese        Japan
ko-KR       Korean      Republic of Korea
nl-BE       Dutch       Belgium
nl-NL       Dutch       Netherlands
no-NO       Norwegian       Norway
pl-PL       Polish      Poland
pt-BR       Portuguese      Brazil
pt-PT       Portuguese      Portugal
ro-RO       Romanian        Romania
ru-RU       Russian     Russian Federation
sk-SK       Slovak      Slovakia
sv-SE       Swedish     Sweden
th-TH       Thai        Thailand
tr-TR       Turkish     Turkey
zh-CN       Chinese     China
zh-HK       Chinese     Hong Kong
zh-TW       Chinese     Taiwan

答案 1 :(得分:9)

以下是如何获取可用语音的BCP-47代码:

for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) {
    NSLog(@"%@", voice.language);
}

Alex的语言环境是“英语 - 美国”(en-US),正如您在“听写”中所看到的那样。 OS X上的语音控制面板。(单击“系统语音”下拉菜单中的“自定义...”。)

答案 2 :(得分:5)

从iOS 7.1开始,以下BCP-47代码有36种声音:

ar-SA
cs-CZ
da-DK
de-DE
el-GR
en-AU
en-GB
en-IE
en-US
en-ZA
es-ES
es-MX
fi-FI
fr-CA
fr-FR
hi-IN
hu-HU
id-ID
it-IT
ja-JP
ko-KR
nl-BE
nl-NL
no-NO
pl-PL
pt-BR
pt-PT
ro-RO
ru-RU
sk-SK
sv-SE
th-TH
tr-TR
zh-CN
zh-HK
zh-TW