Eli Fulkerson .com HomeProjectsCommandline-text-to-speech
 

voice.exe

Description:

Voice.exe is a command line text to speech utility - just a thin wrapper around the builtin System.Speech.Synthesis. There are obviously a lot of variations on this elsewhere (most often called "say.exe") but I wanted to include a couple extra options.

Usage:

input after command: voice [args] stuff to say goes here
-or-
input from stdin: echo something something stdin | voice [args]
-or-
interactive input: "voice -i" then type in whatever you want, hit enter, repeat. Control-C when bored.

"-d" exists as an end-of-argument delimiter. Otherwise you would never be able to say things that might be interpreted as arguments.
"-t" mode allows you to get voice output but still pass the data to some other process in the pipeline
Funky "-s" mode allows you to embed voice into a pipeline and enable scroll lock to get audio from inside the pipe. Does block while speaking, so it will slow everything down. "-s" implies "-t" behavior as well.


voice.exe v0.2 by Eli Fulkerson 28 Dec 2015
Just a thin command line wrapper around System.Speech.Synthesis.
http://www.elifulkerson.com for updates

Usage:  voice [-v VOLUME] [-r RATE] [-n NAME] [-m] [-f] [-l] [-d] [-?]
 -v X   : Speak at volume X, where X is 0 to 100
 -r X   : Speak at rate X, where X is -10 to 10
 -n "X" : Speak using named voice X
 -l     : List availabled named voices
 -m     : Just use a male voice, if available
 -f     : Just use a female voice, if available
 -d     : (Optional) Indicate that arguments are done.
          ... All text to the right of -d will be spoken even if it contains valid arguments.
 -i     : Interactive mode
 -t     : In pipe mode, output text to console as well as read it aloud
 -s     : In pipe mode, copy to stderr and read aloud only when scroll lock is enabled
 -?     : Help and version information

Optional:
For the sake of usability and/or self documentation, the *actual* arguments accepted are...
 -v or /v or /volume or --volume
 -r or /r or /rate or --rate
 -n or /n or /name or --name
 -l or /l or /list or --list
 -m or /m or /male or --male
 -f or /f or /female or --female
 -d or /d or /done or --done
 -i or /i or /interactive or --interactive
 -t or /t or /tee or --tee
 -s or /s or /scroll or --scroll
 -? or --? or /? or /h or -h or /help or --help or -help or nothing at all

Cygwin White Noise Generator:


#!/bin/bash
for i in `seq 1 10`;
do
        cat /dev/urandom|voice -f &
        cat /dev/urandom|voice -m &
done;

Download:

voice.exe
voice-src.zip

See also:

command line wav file player