Metadata-Version: 2.4
Name: autonet-voice-core
Version: 0.1.0
Summary: Shared low-level audio primitives for the kevin and autonet voice services
Author: eightrice
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.23
Requires-Dist: sounddevice>=0.4
Provides-Extra: kokoro
Requires-Dist: kokoro-onnx>=0.4; extra == "kokoro"
Requires-Dist: huggingface_hub>=0.20; extra == "kokoro"
Provides-Extra: edge
Requires-Dist: edge-tts>=6.0; extra == "edge"
Requires-Dist: miniaudio>=1.5; extra == "edge"
Provides-Extra: elevenlabs
Requires-Dist: requests>=2.28; extra == "elevenlabs"
Provides-Extra: ptt
Requires-Dist: keyboard>=0.13; extra == "ptt"
Requires-Dist: faster-whisper>=1.0; extra == "ptt"
Provides-Extra: full
Requires-Dist: kokoro-onnx>=0.4; extra == "full"
Requires-Dist: huggingface_hub>=0.20; extra == "full"
Requires-Dist: edge-tts>=6.0; extra == "full"
Requires-Dist: miniaudio>=1.5; extra == "full"
Requires-Dist: requests>=2.28; extra == "full"
Requires-Dist: keyboard>=0.13; extra == "full"
Requires-Dist: faster-whisper>=1.0; extra == "full"

# voice-core

Shared low-level audio primitives for the **kevin** voice service and the
**autonet** (`autonet-computer[voice]`) `VoiceService`. Both repos used to carry
their own copy of this code; this package is the single source of truth so fixes
land once.

## What's here

| Module | Contents |
|--------|----------|
| `voice_core.audio` | `AudioMixer`, `AudioChannel` (real-time mixing, ducking, fade, per-channel pause), `find_device`, `get_device_list`, `resample` |
| `voice_core.tts`   | `generate_kokoro` / `generate_edge` / `generate_elevenlabs` / `generate_piper`; `set_kokoro_model_dir`, `set_piper_module_dir` |
| `voice_core.stt`   | `PushToTalkRecorder` (duck/mute modes, 30s release-timeout safeguard), `transcribe` (faster-whisper) |
| `voice_core.tones` | `make_tool_tone`, `make_result_chime`, `make_startup_chime`, `make_failure_tone`, `gen_tone` |
| `voice_core.text`  | `strip_markdown` (markdown + emoji stripping for TTS), `tool_summary`, `tool_narration` |

## What's *not* here

Architecture-specific glue stays in each repo:
- **kevin**: UDP instance registry, hooks, window focus, clipboard paste, overlay, `main()`
- **autonet**: `VoiceService` class, EventBus wiring, `VoiceConfig`

## Install

```
pip install -e .            # core only (numpy + sounddevice)
pip install -e .[full]      # all TTS backends + PTT/STT
```

Heavy deps (kokoro-onnx, edge-tts, miniaudio, requests, keyboard,
faster-whisper) are lazy-imported, so the core imports cheaply and each backend
only errors (with an install hint) when used without its dependency.

## Configuring model/voice paths

The Kokoro model files (`kokoro-v1.0.onnx`, `voices-v1.0.bin`) and the Piper
`voice` package live outside this repo. Point at them at startup:

```python
import voice_core
voice_core.set_kokoro_model_dir(r"c:\code\kevin")   # holds the .onnx + .bin
voice_core.set_piper_module_dir(r"c:\code\voice")   # holds the `voice` package
```
