Skip to content

Instantly share code, notes, and snippets.

@nilsding
Created October 12, 2023 14:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nilsding/428d4351f94d072cd3ec708a83449015 to your computer and use it in GitHub Desktop.
Save nilsding/428d4351f94d072cd3ec708a83449015 to your computer and use it in GitHub Desktop.
allow Terminal to access your personal voice
// usage: swift ./personalvoice.swift
//
// after accepting the prompt you can use your personal voice using `say` like this:
// % say -v "Jyrki" "I sure like being inside this fancy computer."
// (replace "Jyrki" with the name of your personal voice, use `say -v '?'` for a list of available voices)
import AVFoundation
if #available(macOS 14.0, *) {
let authorisationStatus = await AVSpeechSynthesizer.requestPersonalVoiceAuthorization();
print("\(authorisationStatus)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment