NSSpeechSynthesizer语音/语言关系

时间:2015-03-19 18:44:46

标签: macos cocoa

不幸的是,我只会说四种语言,所以如果我知道文本的语言,我怎么知道我必须使用哪种OS X语音?我在Apple的文档中找不到任何有关它的信息。是否至少有一个语音/语言表?

2 个答案:

答案 0 :(得分:1)

我会留在这里给别人。

[(["variety"], 4.50, 4.50 ), (["vegetable"], 3.50, 0), (["velvet"], 2.50 2.50) ,(["ve"], 0, 3.50)]

答案 1 :(得分:0)

您可以使用' + attributesForVoice:' NSSpeechSynthesizer上的方法。属性中包含语言环境,例如:

{
    VoiceAge = 35;
    VoiceDemoText = "\U0e2a\U0e27\U0e31\U0e2a\U0e14\U0e35\U0e04\U0e48\U0e30 \U0e14\U0e34\U0e09\U0e31\U0e19\U0e0a\U0e37\U0e48\U0e2dKanya";
    VoiceGender = VoiceGenderFemale;
    VoiceGroup = VoiceGroupCompact;
    VoiceIdentifier = "com.apple.speech.synthesis.voice.kanya";
    VoiceIndividuallySpokenCharacters = (
        {
            UnicodeCharBegin = 33;
            UnicodeCharEnd = 37;
        }, ...
    );
    VoiceLanguage = "th-TH";
    VoiceLocaleIdentifier = "th_TH";
    VoiceName = Kanya;
    VoiceNameRoot = Kanya;
    VoiceNumericID = 604143827;
    VoiceRelativeDesirability = 3800;
    VoiceShowInFullListOnly = 0;
    VoiceSupportedCharacters = (
        {
            UnicodeCharBegin = 33;
            UnicodeCharEnd = 37;
        }, ...
    );
    VoiceSynthesizerNumericID = 1886745202;
    VoiceVersion = "5.0.7";
}