Skip to content

Instantly share code, notes, and snippets.

@xandrucea
Created June 26, 2013 11:30
Show Gist options
  • Save xandrucea/5866721 to your computer and use it in GitHub Desktop.
Save xandrucea/5866721 to your computer and use it in GitHub Desktop.
-f file, --input-file=file
Specify a file to be spoken. If file is - or neither this parameter nor a message is specified, read from standard
input.
--progress
Display a progress meter during synthesis.
-v voice, --voice=voice
Specify the voice to be used. Default is the voice selected in System Preferences. To obtain a list of voices
installed in the system, specify '?' as the voice name.
-r rate, --rate=rate
Speech rate to be used, in words per minute.
-o out.aiff, --output-file=file
Specify the path for an audio file to be written. AIFF is the default and should be supported for most voices, but
some voices support many more file formats.
-n name, --network-send=name
-n name:port, --network-send=name:port
-n :port, --network-send=:port
-n :, --network-send=:
Specify a service name (default "AUNetSend") and/or IP port to be used for redirecting the speech output through
AUNetSend.
-a ID, --audio-device=ID
-a name, --audio-device=name
Specify, by ID or name prefix, an audio device to be used to play the audio. To obtain a list of audio output
devices, specify '?' as the device name.
If the input is a TTY, text is spoken line by line, and the output file, if specified, will only contain audio for the
last line of the input. Otherwise, text is spoken all at once.
AUDIO FORMATS
Starting in MacOS X 10.6, file formats other than AIFF may be specified, although not all third party synthesizers may
initially support them. In simple cases, the file format can be inferred from the extension, although generally some of
the options below are required for finer grained control:
--file-format=format
The format of the file to write (AIFF, caff, m4af, WAVE). Generally, it's easier to specify a suitable file extension
for the output file. To obtain a list of writable file formats, specify '?' as the format name.
--data-format=format
The format of the audio data to be stored. Formats other than linear PCM are specified by giving their format
identifiers (aac, alac). Linear PCM formats are specified as a sequence of:
Endianness (optional)
One of BE (big endian) or LE (little endian). Default is native endianness.
Data type
One of F (float), I (integer), or, rarely, UI (unsigned integer).
Sample size
One of 8, 16, 24, 32, 64.
Most available file formats only support a subset of these sample formats.
To obtain a list of audio data formats for a file format specified explicitly or by file name, specify '?' as the
format name.
The format identifier optionally can be followed by @samplerate and /hexflags for the format.
--channels=channels
The number of channels. This will generally be of limited use, as most speech synthesizers produce mono audio only.
--bit-rate=rate
The bit rate for formats like AAC. To obtain a list of valid bit rates, specify '?' as the rate. In practice, not all
of these bit rates will be available for a given format.
--quality=quality
The audio converter quality level between 0 (lowest) and 127 (highest).
ERRORS
say returns 0 if the text was spoken successfully, otherwise non-zero. Diagnostic messages will be printed to standard
error.
EXAMPLES
say Hello, World
say -v Alex -o hi -f hello_world.txt
say -o hi.aac 'Hello, [[slnc 200]] World'
say -o hi.m4a --data-format=alac Hello, World.
say -o hi.caf --data-format=LEF32@8000 Hello, World
say -v '?'
say --file-format=?
say --file-format=caff --data-format=?
say -o hi.m4a --bit-rate=?
SEE ALSO
"Speech Synthesis Programming Guide"
1.0 2012-01-31 SAY(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment