Storing a voice in User Defaults - Cocoa

81 Views Asked by At

I want to store a voice in the User Defaults. Since we can't store directly a voice, what's the best way for storing it? Using the index in the array [NSSpeechSynthesizer availableVoices] can differ after installing a new voice. And what about converting to an NSData or storing using its identifier?

1

There are 1 best solutions below

0
On BEST ANSWER

Yeah, an index is a really bad idea. I use [[NSSpeechSynthesizer attributesForVoice: voice] objectForKey: NSVoiceName].