Skip to content

Instantly share code, notes, and snippets.

@oleavr
Last active Jul 23, 2020
Embed
What would you like to do?
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