While Linux doe snot provide this command out of the box, there is a package called festival which provides text-to-speech capability:
apt-get install festival festival-freebsoft-utils
The usage is quite straightforward:
echo "this is only a test" | festival --tts
A simple alias can be used to replace /usr/bin/say on the command line:
alias say='festival -tts'
A more script-friendly solution would be to create a small wrapper script that passes /usr/bin/say arguments (filenames or STDIN) to festival:
#!/usr/bin/env ruby
def say(str)
`echo '#{str}' | festival --tts`
end
if __FILE__ == $0
say(ARGF.read)
end
No comments:
Post a Comment