# OmniVoice TTS Codex Skill
Standalone Codex skill project that generates speech with a local OmniVoice install.
## Project Layout
```text
omnivoice-tts-skill/
├── README.md
├── scripts/
│ └── install-skill.sh
└── skill/
└── omnivoice-tts/
├── SKILL.md
├── agents/openai.yaml
└── scripts/omnivoice_tts.py
```
The actual Codex skill folder is:
`skill/omnivoice-tts`
By default, the wrapper expects OmniVoice at Jay's local path:
`/Users/maxazure/jayhome/projects/OmniVoice`
Override that path on other machines:
```bash
export OMNIVOICE_PROJECT=/path/to/OmniVoice
```
## Install OmniVoice
These steps install the OmniVoice project that the skill wraps.
### Prerequisites
- macOS Apple Silicon or another machine supported by PyTorch.
- `uv` installed and available on `PATH`.
- `ffmpeg` available on `PATH`.
- Python 3.13 available to `uv`.
- About 4GB disk space for project dependencies and Hugging Face model cache.
### Clone and Install
```bash
mkdir -p ~/projects
cd ~/projects
gh repo clone k2-fsa/OmniVoice OmniVoice
cd OmniVoice
uv sync --python 3.13
```
Why Python 3.13: the system Python 3.14 was too new for the pinned PyTorch 2.8 wheel. Python 3.13 works with the current OmniVoice dependency set.
### Verify CLI
```bash
cd ~/projects/OmniVoice
uv run omnivoice-infer --help
```
### First Test Generation
The first run downloads `k2-fsa/OmniVoice` from Hugging Face.
```bash
cd ~/projects/OmniVoice
uv run omnivoice-infer \
--model k2-fsa/OmniVoice \
--text "你好,这是 OmniVoice 的中文测试语音。" \
--language Chinese \
--instruct "男,中音调" \
--num_step 8 \
--class_temperature 0 \
--position_temperature 0 \
--output chinese_test.wav
```
Validate the output:
```bash
ffprobe -v error -show_entries stream=codec_name,sample_rate,channels,duration \
-of default=nw=1 chinese_test.wav
```
## Install the Codex Skill
From this project:
```bash
./scripts/install-skill.sh
```
The installer links:
`/Users/maxazure/.codex/skills/omnivoice-tts`
to:
`<this-project>/skill/omnivoice-tts`
If an existing local skill folder exists, the installer moves it to a timestamped backup before creating the symlink.
## Use the Skill Wrapper Directly
```bash
python3 skill/omnivoice-tts/scripts/omnivoice_tts.py \
--text "这里放要生成的中文内容。"
```
Default output directory:
`/Users/maxazure/jayhome/projects/OmniVoice/outputs/`
Override the output directory:
```bash
export OMNIVOICE_OUTPUT_DIR=/path/to/outputs
```
Useful options:
```bash
--output /path/to/output.wav
--num-step 8
--instruct "女,青年,中音调"
--ref-audio /path/to/reference.wav
--ref-text "参考音频中实际说的话。"
--duration 10
--speed 1.1
```
## Voice Consistency
For similar style only, use the same `--instruct`.
For the same speaker-like voice, use the same reference audio every time:
```bash
python3 skill/omnivoice-tts/scripts/omnivoice_tts.py \
--text "这里是新的中文内容。" \
--ref-audio /path/to/reference.wav \
--ref-text "这里写参考音频中实际说的话。" \
--instruct "男,中音调" \
--output output.wav
```
Keep the same reference audio, reference text, language, instruct, speed or duration, `class_temperature`, and `position_temperature` for each segment.
Do not clone a real person's voice unless the user has rights or consent.
## Update Skill Metadata
Validate the skill:
```bash
/Users/maxazure/jayhome/projects/OmniVoice/.venv/bin/python \
/Users/maxazure/.codex/skills/.system/skill-creator/scripts/quick_validate.py \
/Users/maxazure/projects/omnivoice-tts-skill/skill/omnivoice-tts
```
Regenerate UI metadata if `SKILL.md` changes substantially:
```bash
/Users/maxazure/jayhome/projects/OmniVoice/.venv/bin/python \
/Users/maxazure/.codex/skills/.system/skill-creator/scripts/generate_openai_yaml.py \
/Users/maxazure/projects/omnivoice-tts-skill/skill/omnivoice-tts \
--interface display_name="OmniVoice TTS" \
--interface short_description="Local OmniVoice speech generation" \
--interface default_prompt="Use $omnivoice-tts to generate a Chinese voiceover."
```