From 950e6d40ba17eaba8e66bb7e8d0e2328b5150356 Mon Sep 17 00:00:00 2001 From: lypanov Date: Sat, 18 Nov 2006 14:08:04 +0000 Subject: [PATCH] translated slava's old example to work with the latest objc vocabs --- examples/cocoa/speech.factor | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/cocoa/speech.factor diff --git a/examples/cocoa/speech.factor b/examples/cocoa/speech.factor new file mode 100644 index 0000000000..6ec3d706da --- /dev/null +++ b/examples/cocoa/speech.factor @@ -0,0 +1,12 @@ +! Copyright (C) 2006 Slava Pestov +! See http://factorcode.org/license.txt for BSD license. + +IN: cocoa-speech +USING: cocoa objc objc-classes kernel ; + +"NSSpeechSynthesizer" f import-objc-class + +: say ( string -- ) + NSSpeechSynthesizer -> alloc f -> initWithVoice: swap -> startSpeakingString: ; + +"Hello from Factor" say \ No newline at end of file