Search code examples
swiftappkit

What are the acceptable strings for nsspeechsynthesizer's voiceName property in order to change the voice?


I'm working through a tutorial in conjunction with Apple documentation and I'm attempting to change the voiceName of the NSSpeechSynthesizer however its init function says it accepts a string but I'm not sure of how to look up in the documentation to find the acceptable strings in order to change the voice. Apple NSSpeechSynthesizer Initialization Documentation


Solution

  • You should get available names in system

    class var availableVoices: [NSSpeechSynthesizer.VoiceName] { get }
    

    From Here and pass any of them