1 ! Copyright (C) 2013 John Benediktsson
2 ! See https://factorcode.org/license.txt for BSD license
4 USING: combinators command-line generic io kernel math
5 math.text.english namespaces present sequences splitting
6 strings system ui.operations vocabs ;
11 ! 2. festival, freetts, gnuspeech, espeech, flite, etc.
13 ! 4. use google-translate-tts, download and play?
15 HOOK: speak-text os ( str -- )
18 { [ os macosx? ] [ "text-to-speech.macosx" ] }
19 { [ os linux? ] [ "text-to-speech.linux" ] }
20 { [ os windows? ] [ "text-to-speech.windows" ] }
23 GENERIC: speak ( obj -- )
25 M: object speak present speak-text ;
27 M: integer speak number>text speak-text ;
29 [ \ present ?lookup-method ] \ speak H{ } define-operation