Speech synthesis: Difference between revisions
Content added Content deleted
m (→{{header|C}}) |
|||
Line 138: | Line 138: | ||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |
||
<lang PicoLisp>(call 'espeak "This is an example of speech synthesis.")</lang> |
<lang PicoLisp>(call 'espeak "This is an example of speech synthesis.")</lang> |
||
=={{header|Racket}}== |
|||
Should work on all platforms. |
|||
<lang racket> |
|||
#lang racket |
|||
(require racket/lazy-require) |
|||
(lazy-require [ffi/com (com-create-instance com-release com-invoke)]) |
|||
(define (speak text) |
|||
(cond [(eq? 'windows (system-type)) |
|||
(define c (com-create-instance "SAPI.SpVoice")) |
|||
(com-invoke c "Speak" text) |
|||
(com-release c)] |
|||
[(ormap find-executable-path '("say" "espeak")) |
|||
=> (λ(exe) (void (system* exe text)))] |
|||
[else (error 'speak "I'm speechless!")])) |
|||
(speak "This is an example of speech synthesis.") |
|||
</lang> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |