标签: cocoa nsuserdefaults voice speechsynthesizer
我想在用户默认值中存储语音。由于我们无法直接存储语音,存储它的最佳方式是什么?安装新语音后,使用数组[NSSpeechSynthesizer availableVoices]中的索引可能会有所不同。那么转换为NSData或使用其标识符存储呢?
[NSSpeechSynthesizer availableVoices]
NSData
答案 0 :(得分:1)
是的,索引是一个非常糟糕的主意。我使用[[NSSpeechSynthesizer attributesForVoice: voice] objectForKey: NSVoiceName]。
[[NSSpeechSynthesizer attributesForVoice: voice] objectForKey: NSVoiceName]