← 返回命令列表

Linux command

say 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Speak text aloud

say "[Hello, world]"

Speak with a specific voice

say -v [Alex] "[Hello]"

List all available voices

say -v "?"

Speak text from a file

say -f [input.txt]

Save speech to an audio file

say -o [output.aiff] "[Hello, world]"

Speak at a specific rate

say -r [200] "[Speaking faster now]"

Speak to a specific audio device

say -a "[Built-in Output]" "[Hello]"

Highlight words interactively as they are spoken

say -i "[Hello, this highlights each word]"

Save speech as a WAVE file

say --file-format=WAVE -o [output.wav] "[Hello, world]"

说明

say converts text to audible speech using the macOS Speech Synthesis manager. It speaks text provided as arguments, from a file, or from standard input, either through audio output or saved to a file. Multiple voices are available with different accents, languages, and personalities. The default voice and speech settings can be configured in System Settings under Accessibility > Spoken Content. Output can be saved to AIFF, WAVE, m4af, or caff audio formats for later playback or processing.

参数

-v _voice_
Use the specified voice instead of the system default. Use '?' to list all available voices.
-r _rate_
Speech rate in words per minute.
-f _file_
Read text from the specified file. Use '-' for standard input.
-o _file_
Save speech to an audio file (AIFF by default; format depends on --file-format).
-a _device_
Specify audio output device by ID or name prefix. Use '?' to list devices.
-n _name:port_
Redirect speech output through AUNetSend to a remote audio server.
-i, --interactive
Print text line by line during synthesis, highlighting words as they are spoken.
--progress
Display progress during synthesis: percentage done, elapsed time, and bytes.
--file-format _FORMAT_
Output file format: AIFF, caff, m4af, or WAVE.
--data-format _FORMAT_
Audio data format (e.g., aac, alac, LEI16).
--bit-rate _RATE_
Bit rate for compressed formats like AAC. Use '?' to list valid rates.
--quality _LEVEL_
Audio converter quality level between 0 (lowest) and 127 (highest).
--channels _N_
Number of output audio channels.

FAQ

What is the say command used for?

say converts text to audible speech using the macOS Speech Synthesis manager. It speaks text provided as arguments, from a file, or from standard input, either through audio output or saved to a file. Multiple voices are available with different accents, languages, and personalities. The default voice and speech settings can be configured in System Settings under Accessibility > Spoken Content. Output can be saved to AIFF, WAVE, m4af, or caff audio formats for later playback or processing.

How do I run a basic say example?

Run `say "[Hello, world]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v _voice_ do in say?

Use the specified voice instead of the system default. Use '?' to list all available voices.