Skip to content

Instantly share code, notes, and snippets.

@oleavr
Last active July 23, 2020 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oleavr/8653df4b37b4092bcaf3f9649d98784d to your computer and use it in GitHub Desktop.
Save oleavr/8653df4b37b4092bcaf3f9649d98784d to your computer and use it in GitHub Desktop.
How to pronounce “Scapy”, according to macOS
setImmediate(function () {
var NSAutoreleasePool = ObjC.classes.NSAutoreleasePool;
var NSSpeechSynthesizer = ObjC.classes.NSSpeechSynthesizer;
var pool = NSAutoreleasePool.alloc().init();
try {
var synth = NSSpeechSynthesizer.alloc().init();
var voices = NSSpeechSynthesizer.availableVoices();
var n = voices.count().valueOf();
for (var i = 0; i !== n; i++) {
console.log('[*] Voice', i + 1, 'out of', n);
synth.setVoice_(voices.objectAtIndex_(i));
synth.startSpeakingString_('Scapy');
do {
Thread.sleep(0.05);
} while (synth.isSpeaking());
}
} finally {
pool.release();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment