text-to-speech: simple cross-platform text-to-speech.

db4
John Benediktsson 2015-04-01 14:05:55 -07:00
parent 05b087fb07
commit 59ec7f599e
7 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1 @@
John Benediktsson

View File

@ -0,0 +1,10 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: formatting io io.encodings.utf8 io.launcher system
text-to-speech ;
IN: text-to-speech.linux
M: linux speak-text
"festival --tts" utf8 [ print ] with-process-writer ;

View File

@ -0,0 +1,9 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: formatting io.launcher system text-to-speech ;
IN: text-to-speech.macosx
M: macosx speak-text
"say \"%s\"" sprintf try-process ;

View File

@ -0,0 +1 @@
Text-to-speech utility

View File

@ -0,0 +1,28 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: combinators generic kernel math math.text.english present
strings system ui.operations vocabs ;
IN: text-to-speech
! 1. "say"
! 2. festival, freetts, gnuspeech, espeech, flite, etc.
! 3. core-audio?
! 4. use google-translate-tts, download and play?
HOOK: speak-text os ( str -- )
{
{ [ os macosx? ] [ "text-to-speech.macosx" ] }
{ [ os linux? ] [ "text-to-speech.linux" ] }
{ [ os windows? ] [ "text-to-speech.windows" ] }
} cond require
GENERIC: speak ( obj -- )
M: object speak present speak-text ;
M: integer speak number>text speak-text ;
[ \ present ?lookup-method ] \ speak H{ } define-operation

View File

@ -0,0 +1 @@
windows

View File

@ -0,0 +1,9 @@
! Copyright (C) 2013 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
USING: google.translate system text-to-speech windows.winmm ;
IN: text-to-speech.windows
M: windows speak-text
translate-tts open-command play-command close-command ;