1
0
Fork
You've already forked opencode-talk
0
Currently using tts to get voice from the agent.
  • Python 80.9%
  • Makefile 10.9%
  • TypeScript 5.5%
  • Rust 2.7%
2026年03月16日 23:47:04 +01:00
.opencode/tools initial commit 2026年03月16日 23:47:04 +01:00
audio-player initial commit 2026年03月16日 23:47:04 +01:00
bin initial commit 2026年03月16日 23:47:04 +01:00
models initial commit 2026年03月16日 23:47:04 +01:00
voice_project initial commit 2026年03月16日 23:47:04 +01:00
.dockerignore initial commit 2026年03月16日 23:47:04 +01:00
.gitignore initial commit 2026年03月16日 23:47:04 +01:00
AGENTS.md initial commit 2026年03月16日 23:47:04 +01:00
Containerfile.dev initial commit 2026年03月16日 23:47:04 +01:00
LICENSE initial commit 2026年03月16日 23:47:04 +01:00
LICENSE-COMMERCIAL initial commit 2026年03月16日 23:47:04 +01:00
Makefile initial commit 2026年03月16日 23:47:04 +01:00
pyproject.toml initial commit 2026年03月16日 23:47:04 +01:00
README.md initial commit 2026年03月16日 23:47:04 +01:00

Voice Project for OpenCode

Self-contained voice capabilities (STT + TTS) for OpenCode AI assistant.

What It Does

  • TTS (Text-to-Speech): Convert text to audio and speak it
  • STT (Speech-to-Text): Transcribe audio to text
  • 100% Local: No cloud services, runs entirely on your machine

Two Ways to Run

Zero setup - everything runs in a container.

# Build container with all tools
make dev-build
# Run tests
make test

Option 2: Native Linux Install

Install directly on your Linux system.


System Dependencies

Before installing, you need these system packages:

# Ubuntu/Debian
sudo apt install -y \
 libportaudio2 \
 portaudio19-dev \
 libasound2-dev
# Fedora/RHEL
sudo dnf install -y portaudio-tools

Installation

1. Install uv (Python package manager)

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Clone and Install

# Clone the project
git clone <repo-url>
cd voice_project
# Create virtual environment
uv venv .venv
source .venv/bin/activate
# Install with all features
uv pip install -e ".[all]"

Quick Test

# Run unit tests (no hardware needed)
pytest
# Test TTS - generate audio file
voice-tts --text "Hello world" --output test.wav
# Play the audio
aplay test.wav # Linux
afplay test.wav # macOS

OpenCode Integration

To use with OpenCode:

# Copy the voice tool to OpenCode
cp .opencode/tools/voice.ts ~/.config/opencode/tools/voice.ts

The tool will be available as voice in OpenCode.


Architecture

voice_project/
├── .opencode/tools/ # OpenCode tools
│ └── voice.ts # Voice output tool
├── voice_project/ # Python package
│ ├── bin/ # CLI entry points
│ ├── tts/ # Text-to-speech backends
│ ├── stt/ # Speech-to-text
│ └── utils/ # Audio utilities
├── audio-player/ # Rust audio player
├── tests/ # Unit tests
├── Makefile # Container commands
└── pyproject.toml # Dependencies

Available Commands

# Text-to-Speech
voice-tts --text "Hello" --play
voice-tts --text "Hello" --output file.wav
# Speech-to-Text
voice-stt audio.wav --model tiny
# Audio Recording
voice-record 5 output.wav

Development

# Run all tests
make test
# Run linters
make lint
# Build Rust audio player
make build
# Clean build artifacts
make clean