ai-say

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Say

AI Say

Local text-to-speech via
~/.local/bin/ai-say
. Kokoro-first with flite and speech-dispatcher fallbacks. Requires the voice stack to be installed first.
本地文本转语音功能通过
~/.local/bin/ai-say
实现。优先使用Kokoro TTS,同时支持flite和speech-dispatcher作为回退方案。使用前需先安装语音栈。

Prerequisites

前置要求

The voice stack must be installed before using this skill:
bash
git clone https://github.com/Ema93sh/ai-voice-stack.git
cd ai-voice-stack
scripts/voice-up-setup.sh --with-system-deps
This installs
ai-say
to
~/.local/bin/
and sets up Kokoro TTS.
使用本技能前必须先安装语音栈:
bash
git clone https://github.com/Ema93sh/ai-voice-stack.git
cd ai-voice-stack
scripts/voice-up-setup.sh --with-system-deps
此操作会将
ai-say
安装到
~/.local/bin/
并配置Kokoro TTS。

Usage

使用方法

Speak text:
bash
~/.local/bin/ai-say "Hello world"
Pipe text:
bash
echo "Read this aloud" | ~/.local/bin/ai-say
Temporary voice override:
bash
AI_KOKORO_VOICE=am_michael ~/.local/bin/ai-say "Different voice"
朗读文本:
bash
~/.local/bin/ai-say "Hello world"
管道输入文本:
bash
echo "Read this aloud" | ~/.local/bin/ai-say
临时切换语音:
bash
AI_KOKORO_VOICE=am_michael ~/.local/bin/ai-say "Different voice"

Available Voices

可用语音

English (American)

美式英语

Female:
af_alloy
,
af_aoede
,
af_bella
,
af_heart
(default),
af_jessica
,
af_kore
,
af_nicole
,
af_nova
,
af_river
,
af_sarah
,
af_sky
Male:
am_adam
,
am_echo
,
am_eric
,
am_fenrir
,
am_liam
,
am_michael
,
am_onyx
,
am_puck
,
am_santa
女声:
af_alloy
,
af_aoede
,
af_bella
,
af_heart
(默认),
af_jessica
,
af_kore
,
af_nicole
,
af_nova
,
af_river
,
af_sarah
,
af_sky
男声:
am_adam
,
am_echo
,
am_eric
,
am_fenrir
,
am_liam
,
am_michael
,
am_onyx
,
am_puck
,
am_santa

English (British)

英式英语

Female:
bf_alice
,
bf_emma
,
bf_isabella
,
bf_lily
Male:
bm_daniel
,
bm_fable
,
bm_george
,
bm_lewis
女声:
bf_alice
,
bf_emma
,
bf_isabella
,
bf_lily
男声:
bm_daniel
,
bm_fable
,
bm_george
,
bm_lewis

Other Languages

其他语言

Spanish (
ef_dora
,
em_alex
), French (
ff_siwis
), Hindi (
hf_alpha
,
hf_beta
,
hm_omega
,
hm_psi
), Italian (
if_sara
,
im_nicola
), Japanese (
jf_alpha
,
jf_gongitsune
,
jf_nezumi
,
jf_tebukuro
,
jm_kumo
), Portuguese (
pf_dora
,
pm_alex
), Chinese (
zf_xiaobei
,
zf_xiaoni
,
zf_xiaoxiao
,
zf_xiaoyi
,
zm_yunjian
,
zm_yunxi
,
zm_yunxia
,
zm_yunyang
)
西班牙语(
ef_dora
,
em_alex
)、法语(
ff_siwis
)、印地语(
hf_alpha
,
hf_beta
,
hm_omega
,
hm_psi
)、意大利语(
if_sara
,
im_nicola
)、 日语(
jf_alpha
,
jf_gongitsune
,
jf_nezumi
,
jf_tebukuro
,
jm_kumo
)、 葡萄牙语(
pf_dora
,
pm_alex
)、中文(
zf_xiaobei
,
zf_xiaoni
,
zf_xiaoxiao
,
zf_xiaoyi
,
zm_yunjian
,
zm_yunxi
,
zm_yunxia
,
zm_yunyang

Persistent Voice Change

永久切换语音

Edit
~/.config/ai-audio.env
:
bash
export AI_KOKORO_VOICE="${AI_KOKORO_VOICE:-af_bella}"
编辑
~/.config/ai-audio.env
文件:
bash
export AI_KOKORO_VOICE="${AI_KOKORO_VOICE:-af_bella}"

Volume / Gain

音量 / 增益

If speech is too quiet:
bash
export AI_KOKORO_GAIN_DB=18
~/.local/bin/ai-say "Volume test"
如果语音音量太小:
bash
export AI_KOKORO_GAIN_DB=18
~/.local/bin/ai-say "Volume test"

Diagnostics

诊断工具

Check stack health:
bash
~/.local/bin/voice-status
Check audio devices:
bash
pactl list short sinks
pactl list short sources
cat ~/.config/ai-audio.env
Test direct tone on a specific sink:
bash
ffmpeg -hide_banner -loglevel error -f lavfi -i 'sine=frequency=880:duration=3' -f wav - | paplay --device='<sink-name>'
检查语音栈健康状态:
bash
~/.local/bin/voice-status
检查音频设备:
bash
pactl list short sinks
pactl list short sources
cat ~/.config/ai-audio.env
在指定输出设备上测试直接音调:
bash
ffmpeg -hide_banner -loglevel error -f lavfi -i 'sine=frequency=880:duration=3' -f wav - | paplay --device='<sink-name>'

Subcommands

子命令

Install

安装

Run the full voice stack installer. Finds the repo automatically or clones it:
bash
bash scripts/install.sh --with-system-deps
运行完整的语音栈安装程序。会自动查找仓库或进行克隆:
bash
bash scripts/install.sh --with-system-deps

Doctor

诊断

Check installation health — reports PASS/FAIL for every component:
bash
bash scripts/doctor.sh
检查安装健康状态——会报告每个组件的通过/失败状态:
bash
bash scripts/doctor.sh

Notes

注意事项

  • ai-say
    is Kokoro-first, with flite and spd-say fallback paths.
  • Text is truncated at 1600 chars and chunked at 320 chars for reliable playback.
  • Keep messages respectful and follow user intent exactly for spoken content.
  • ai-say
    优先使用Kokoro TTS,同时支持flite和spd-say作为回退方案。
  • 文本会被截断为1600字符,并按320字符分段以保证可靠播放。
  • 朗读内容需保持得体,并严格遵循用户的需求。