Re: [SLUG] text-to-speech script

From: Dylan William Hardison (dylan@hardison.net)
Date: Thu Oct 02 2008 - 10:18:04 EDT


Spake Eben King on Wednesday, October 01, 2008 at 11:46PM -0400:
> Yes, there are other ways of doing this, so in some respect I'm
> reinventing the wheel. My initial goal (when I wrote this in (pd)ksh)
> was to get it done, since there was no other way (that I saw) of doing
> this without incurring a significant amount of overhead. Now there
> probably is, but since some scripts depend on it, I'll rewrite it in sh.
>
> Festival isn't particularly lightweight, but I guess you can use whatever
> you want. It acts as a daemon, accepting festival-language commands
> (LISP, I think) over TCP port 1314. This script sends $* as one
> statement. If that fails, it sends one word at a time. If a word fails,
> it resends that word as l e t t e r s.
>
> #!/bin/sh
> # eben wrote this
>
> saytext () {
> netcat -c "echo '(SayText \"$*\")' ;
> while read line ; do
> case \"z\$line\" in
> *OK) exit ;;
> zER) exit 1 ;;
> esac
> done
> echo '(quit)'" localhost 1314
> }
>
> saytext "$@" || {
> echo -E "`date`" "$*" >> /tmp/say.errors
> set $*
> for word in "$@" ; do
> saytext "$word" || saytext "$(echo "$word" | sed 's/\(.\)/\1 /g')"
> done
> }
>
> I call at "say".

You might also be interested in flite (which uses festival, but is more light-weight),
and espeak (which does not use festival, and is better for long texts.)

Both flite and espeak have interfaces similar to your script.

Also, espeak can speak a variety of languages, and accents -- including
a scottish (glaswegian, I think) accent, although I
haven't been able make it work quite right.

-- 
Really, I'm not out to destroy Microsoft. That will just be a
completely unintentional side effect.
              -- Linus Torvalds
-
GPG Fingerprint: 1AD8 69DD F56A E7AB 421C  7D8A C66D 87D9 82CD 4AE4.
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:14:18 EDT