Giving OpenCode a Voice
A useful tool for listening to OpenCode responses
When I use OpenCode, it sometimes responds with a wall of text. There can be important details in there, and it helps me to hear the response spoken aloud.
I built on Semir Huduti’s OpenCode text-to-speech plugin, which provides the speech generation and playback foundation. I’ve made substantial changes and now maintain this fork independently in my repository; it is not an official version of, or endorsed by, the original author. If you find the original work useful, please consider buying Semir a coffee.
Installation
The public package and its OpenCode installation instructions are not final yet. Once the package is published, the intended installation will be:
PLACEHOLDER: npm package name and install command
PLACEHOLDER: OpenCode plugin configuration snippet
Until then, see the GitHub repository for the current development setup. Replace these placeholders with verified public-release instructions before publishing this post.
What I added
- Ctrl+F9 pop-up menu: A menu that brings the existing voice and playback options together and shows their shortcuts.
- Speech-speed controls: Keyboard shortcuts to slow down or speed up speech, in quarter-step increments from 0.25× to 5×.
- Remembered selections: The plugin remembers the speed and voice you selected, so you don’t have to edit configuration files each time. Explicit configuration still takes precedence.
- Searchable voice picker: Search 28 English voices by name, accent, gender, or ID; preview a voice with Ctrl+O and select it with Enter.
- Tests and scripts: Automated tests, an audio test, and a build-and-deploy script.
- Quick Start Guide: Instructions for building and loading the plugin locally, including macOS and WSL/Ubuntu. Public npm installation instructions will be added once the release details are confirmed.
What I improved
- OpenCode V2 support: Updated the plugin integration for V2, including TUI integration, message streaming, history retrieval, session handling, and state communication.
- Dependency maintenance: Updated dependencies and added npm
overridesforglob,minimatch, andsharpin response to npm audit advisories. This records the changes made; it is not a claim that all vulnerabilities are resolved or that a fresh audit has no findings.
A note on the original plugin
The original plugin already had function-key shortcuts and command palette options for playback actions, including pausing or resuming, replaying the latest response, and enabling or disabling speech. I added the Ctrl+F9 pop-up menu to make those existing options easier to find; the actions themselves were already there.