Skip to main content
Agent Voice logo

https://github.com/user-attachments/assets/975dcfd0-17ec-4912-b3b1-ec084077f858

Agent Voice gives AI agents the ability to create local speech recordings.

AI agents produce useful work, but they still communicate mostly through text. Every response competes for a developer's visual attention, so valuable work is often skimmed or missed.

My initial use case was listening alongside the text: text-to-speech for coding agents such as Codex and Claude Code.

The larger idea is simple: audio should be a first-class medium for agents.

Agent Voice runs locally, uses Kokoro-82M, and requires no API key. English is the best-supported language. The bundled 54-voice catalog also covers Japanese, Mandarin Chinese, Spanish, French, Hindi, Italian, and Brazilian Portuguese, though quality varies.

Check them out here.

Install and setup

Install the CLI and download the speech model:

uv tool install agent-voice
agent-voice setup

Install the skills for your surface.

For CLIs and portable Markdown delivery:

npx skills add yoav0gal/agent-voice --skill create-speech-recording --global
npx skills add yoav0gal/agent-voice --skill spoken-response --global

For Codex Desktop or OpenCode Desktop players:

npx skills add yoav0gal/agent-voice --skill create-speech-recording-desktop --global
npx skills add yoav0gal/agent-voice --skill spoken-response-desktop --global

Test it:

agent-voice speak "Hello from Agent Voice." --play

Skills

Agent Voice includes two workflows, each with portable and desktop delivery:

  • create-speech-recording turns supplied text into audio. Use it when you want an agent to create a recording or read something aloud.
  • spoken-response creates an audio version of an agent's written response. Use it when you want to listen to a long answer instead of reading it.
  • Add -desktop to either name for an embedded Codex Desktop or OpenCode Desktop player. Desktop skills are explicitly invoked in Codex.

These skills are starting points, not fixed workflows. Copy them, edit them, and make them yours. You can change delivery wording, recording defaults, playback behavior, or when the agent should offer audio.

Each skill owns its delivery references. The CLI returns structured facts; the installed skill decides how those facts are presented.

CLI

The CLI provides small primitives that agents can combine. Run agent-voice COMMAND --help for the full options of any command.

Command What it does
setup Download and verify speech model assets.
speak Turn text or stdin into a recording.
play Play an existing local recording.
voices List supported language tags and voices.
models List speech models and variants.
config View or change persistent defaults.
doctor Check that Agent Voice is ready.
viewer start|stop Manage the local recording viewer.
serve Start the localhost speech API.

Speak

# Positional text
agent-voice speak "The build is finished."

# Agent output through stdin
printf '%s' "$TEXT" | agent-voice speak --label build-summary

# Spoken response text and written response Markdown in one command
agent-voice speak "$RESPONSE_AS_TEXT" \
  --markdown "$RESPONSE_AS_MARKDOWN" --label response

# Use separate files for a long spoken response and its written Markdown
agent-voice speak --response-file "$RESPONSE_AS_MARKDOWN_FILE" \
  < "$RESPONSE_AS_TEXT_FILE"

# Choose the output and delivery
agent-voice speak "Here is your summary." \
  --voice bf_emma --speed 1.2 --format mp3 --play
Option Purpose
-o, --output PATH Write to an exact path.
--label TEXT Set the managed filename prefix.
--markdown TEXT Show an inline Markdown response in the viewer.
--response-file PATH Show a Markdown response in the browser viewer.
--output-dir DIR Choose the managed output directory.
-f, --format FORMAT Use wav, mp3, opus, or m4a.
-v, --voice NAME Select a voice.
--lang TAG Set the language tag (default: en-us).
--speed NUMBER Set pitch-preserving playback speed.
--play Play the recording after creation.
--service on|off|timed Control background inference.
--service-timeout MINUTES Set the idle timeout for timed mode.
--model-id ID, --variant NAME Select a model and build.

speak prints one JSON receipt with the absolute recording path, file URI, audio metadata, playback status, and available viewer links. This makes the command reliable for both people and agents.

Configure defaults

# Show current defaults
agent-voice config

# Set your preferred voice, speed, format, and output directory
agent-voice config --voice bf_emma --speed 1.15 --format mp3 --output-dir ./recordings

# Restore built-in defaults
agent-voice config --reset

The same values can be overridden per recording with speak. Service modes are on for a persistent local service, off for embedded inference, and timed to stop the service after an idle timeout.

Discover and diagnose

agent-voice voices
agent-voice models
agent-voice doctor
agent-voice doctor --json

voices groups each installed voice under its supported --lang tag. Select a pair with agent-voice speak --lang TAG --voice VOICE "Text".

Use --json with voices, models, config, or doctor when another tool or agent will consume the result.

Play and view recordings

agent-voice play "/absolute/path/recording.mp3"
agent-voice viewer start
agent-voice viewer stop

The lightweight viewer starts automatically when needed and serves only local recordings. It prefers http://127.0.0.1:8779 and selects a free port if that port is unavailable. Each managed recording keeps an editable .txt source beside it. At startup and every six hours, the viewer removes owned audio older than four days and 18 hours; files without Agent Voice source, transcript, and language metadata are left alone. Opening a player or audio URL regenerates missing audio from its source with the original language and current voice and speed.

🗒️ The viewer is a workaround for agent surfaces that do not support embedded audio. I expect native text-to-speech to become common across these platforms, which would be a better solution. For now, the viewer keeps playback and the written response together in a local page. 🗒️

Local speech API

agent-voice serve

curl http://127.0.0.1:8765/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{"input":"The task is complete.","voice":"af_heart","response_format":"mp3"}' \
  --output speech.mp3

The API binds to localhost. speak uses it when available and falls back to embedded inference.

Platform limitations

Prebuilt dependencies support macOS arm64/x64, Linux x64, and Windows x64. Linux arm64 requires a C build toolchain for miniaudio. On Windows arm64, use x64 Python under emulation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_voice-0.7.0.tar.gz (988.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_voice-0.7.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

Details for the file agent_voice-0.7.0.tar.gz.

File metadata

  • Download URL: agent_voice-0.7.0.tar.gz
  • Upload date:
  • Size: 988.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_voice-0.7.0.tar.gz
Algorithm Hash digest
SHA256 40c4a78bfbd40c9b7df025f8ea807f8f3b3e5c78fb2dfadc36faf1e4880cc438
MD5 e469d7e4a656d9da22c57dcfa1fdcb2d
BLAKE2b-256 ec5c9d7a61401d36062d81765971c99b43db0998cb0bb24a373cb5a14547de2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_voice-0.7.0.tar.gz:

Publisher: publish.yml on yoav0gal/agent-voice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agent_voice-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: agent_voice-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agent_voice-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b081c56c9de58962c0c056c61d62205dc4f19399d71ea1abe846c769f87f8cf
MD5 da4b43cce924301edfdaaba46cd268ab
BLAKE2b-256 cf4eef5b805175aa7b46620a8ef5a348e6d5cdceb38295a623b0e5abc6d31548

See more details on using hashes here.

Provenance

The following attestation bundles were made for agent_voice-0.7.0-py3-none-any.whl:

Publisher: publish.yml on yoav0gal/agent-voice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page