【问题标题】:Why can't I use downloaded voices for speech Synthesis in Lion?为什么我不能在 Lion 中使用下载的语音进行语音合成?
【发布时间】:2012-05-22 00:15:47
【问题描述】:

这让我发疯了,所以我想我会在这里记录答案。

要选择一个声音,你给 -[NSSpeechSynthesizer initWithVoice] 反向 DNS 格式的标识符,例如com.apple.speech.synthesis.voice.Agnes 但是如果用户下载了一个,比如 Paolo,你就不能以同样的方式访问它。

【问题讨论】:

    标签: cocoa speech-synthesis


    【解决方案1】:

    答案是 Apple 将其命名为“voice.premium”,因此您可以使用 com.apple.speech.synthesis.voice.paolo.premium 访问 Paolo。因此,即使我得到了 [NSSpeechSynthesizer availableVoices] 的列表,我也只打印了最后一个单词,并没有注意到列表中添加了溢价。要在avalabVoices 中获取voiceIdentifier 的真实可打印名称(而不是查看最后一个单词),请使用:

    [[NSSpeechSynthesizer attributesForVoice:voiceIdentifier] 
        valueForKey: NSVoiceName] 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多