Skip to content

Instantly share code, notes, and snippets.

@thomaswitt
Created January 19, 2024 10:30
Show Gist options
  • Save thomaswitt/55d75ff18598b56e30f9f379686c44b1 to your computer and use it in GitHub Desktop.
Save thomaswitt/55d75ff18598b56e30f9f379686c44b1 to your computer and use it in GitHub Desktop.
Enable "Personal Voice" in a terminal to use 'say' with your own voice
/*
Compile via:
gcc -x objective-c -framework AVFoundation -framework Foundation personal-voice.c -o personal-voice
Run it in a terminal (make sure you authorized apps to use your personal voice)
*/
#import <AVFoundation/AVFoundation.h>
int main(){
[AVSpeechSynthesizer requestPersonalVoiceAuthorizationWithCompletionHandler:^(AVSpeechSynthesisPersonalVoiceAuthorizationStatus status){
// authorization popup should be visible now
}];
[[NSRunLoop currentRunLoop] run];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment