我知道,它可能是与其他一些类似的实体分组成某种枚举。但是搜索Google,搜索程序集没有返回任何答案。那么,NSVoiceLocaleIdentifier on Xamarin.Mac在哪里?
发布于 2017-03-28 13:58:39
注意:编译时验证有“无”定义常量,因为NSVoiceLocaleIdentifier字符串基于操作系统安装是动态的。如果您想要一个完整的列表,您必须在应用程序运行时查找它们。
NSVoiceLocaleIdentifier在为特定语音返回的NSDictionary中可用。
我的系统上没有塞尔维亚人(sv_SV),但还有64人.
即
en_US)fr-FR)示例:
foreach (var voice in NSSpeechSynthesizer.AvailableVoices)
{
Console.WriteLine(voice);
var attributes = NSSpeechSynthesizer.AttributesForVoice(voice);
foreach (var item in attributes)
{
if (item.Key.ToString() == "VoiceIndividuallySpokenCharacters" ||
item.Key.ToString() == "VoiceSupportedCharacters")
continue;
Console.WriteLine($"\t{item.Key}:{item.Value}");
}
Console.WriteLine();
}示例输出:
com.apple.speech.synthesis.voice.Zarvox
VoiceShowInFullListOnly:1
VoiceGender:VoiceGenderNeuter
VoiceIdentifier:com.apple.speech.synthesis.voice.Zarvox
VoiceVersion:3.6
VoiceDemoText:That looks like a peaceful planet.
VoiceLanguage:en-US
VoiceAge:1
VoiceName:Zarvox
VoiceLocaleIdentifier:en_US
com.apple.speech.synthesis.voice.thomas
VoiceName:Thomas
VoiceGroup:VoiceGroupCompact
VoiceLocaleIdentifier:fr_FR
VoiceShowInFullListOnly:0
VoiceDemoText:Bonjour, je m’appelle Thomas. Je suis une voix française.
VoiceGender:VoiceGenderMale
VoiceNumericID:251973347
VoiceAge:35
VoiceIdentifier:com.apple.speech.synthesis.voice.thomas
VoiceVersion:5.0.7
VoiceNameRoot:Thomas
VoiceSynthesizerNumericID:1886745202
VoiceRelativeDesirability:3800
VoiceLanguage:fr-FRhttps://stackoverflow.com/questions/43067547
复制相似问题