Created
October 12, 2023 14:32
-
-
Save nilsding/428d4351f94d072cd3ec708a83449015 to your computer and use it in GitHub Desktop.
allow Terminal to access your personal voice
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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