Fix speech demo

slava 2006-11-29 08:06:10 +00:00
parent 0fcb88e7cb
commit ab82df816c
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,7 @@
! Copyright (C) 2006 Slava Pestov ! Copyright (C) 2006 Slava Pestov
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
IN: objc-classes
DEFER: NSSpeechSynthesizer
IN: cocoa-speech IN: cocoa-speech
USING: cocoa objc objc-classes kernel ; USING: cocoa objc objc-classes kernel ;
@ -7,6 +9,7 @@ USING: cocoa objc objc-classes kernel ;
"NSSpeechSynthesizer" f import-objc-class "NSSpeechSynthesizer" f import-objc-class
: say ( string -- ) : say ( string -- )
NSSpeechSynthesizer -> alloc f -> initWithVoice: swap <NSString> -> startSpeakingString: drop ; NSSpeechSynthesizer -> alloc f -> initWithVoice: swap
<NSString> -> startSpeakingString: drop ;
"Hello from Factor" say "Hello from Factor" say