Gives your OpenCode AI a voice. Instead of only reading its answers, you hear them.
Copy this line into PowerShell, press Enter, and follow what it says:
powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/humbleangel/opencode-tool-speak/main/install-windows.ps1 | iex"(Keep reading below only if you prefer to install by hand.)
-
Python — download it from python.org. On Windows, tick the box "Add python.exe to PATH" during installation.
-
A sound player — the easiest is ffmpeg (it includes
ffplay): download it from ffmpeg.org and add it to PATH. VLC also works. -
One small library — open a terminal and run:
pip install edge-tts
- Copy these 3 files into your OpenCode tools folder:
speak.py,speak.ts,speak.json- Windows:
C:\Users\YOUR-NAME\.config\opencode\tools\ - Mac/Linux:
~/.config/opencode/tools/
- Restart OpenCode.
- Done. On its very first message, the agent will tell you out loud that it can speak and listen, and ask if you want that always on.
- Just chat — the agent speaks on its own.
- To change the voice, ask in plain words, e.g. "use a British female voice".
- Voices are grouped by language (
en-US-...English,fr-FR-...French, and so on). If the accent sounds wrong, the voice doesn't match the language of the text — ask for a voice in your language.
- No sound? Install ffmpeg, then close and reopen your terminal (so it picks up the new PATH) and restart OpenCode.
- Error mentioning edge-tts? Run
pip install edge-ttsagain. - Strange pronunciation of words with accents? The voice language must match your text — ask for a voice in your language. (Technical note: this tool forces the speech request to use the voice's own language, which stock setups get wrong.)
MIT — free for everyone, see LICENSE.