agentvibes 2.0.3 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/agent-vibes/provider.md +54 -0
- package/.claude/hooks/piper-download-voices.sh +133 -0
- package/.claude/hooks/piper-voice-manager.sh +227 -0
- package/.claude/hooks/play-tts-elevenlabs.sh +201 -0
- package/.claude/hooks/play-tts-piper.sh +175 -0
- package/.claude/hooks/play-tts.sh.backup-20251005-163851 +138 -0
- package/.claude/hooks/provider-commands.sh +374 -0
- package/.claude/hooks/provider-manager.sh +196 -0
- package/.claude/language-voices.yaml +372 -0
- package/.claude/piper-voices/en_US-lessac-medium.onnx +0 -0
- package/.claude/piper-voices/en_US-lessac-medium.onnx.json +493 -0
- package/.mcp-minimal.json +53 -0
- package/README.md +2 -2
- package/docs/ai-optimized-documentation-standards.md +306 -0
- package/docs/architecture/provider-system.md +574 -0
- package/docs/voice-mapping-format.md +218 -0
- package/package.json +1 -1
- package/scripts/piper-voice/README.md +145 -0
- package/scripts/piper-voice/wsl-install.sh +193 -0
- package/src/installer.js +248 -21
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Voice Mapping Format Specification
|
|
2
|
+
|
|
3
|
+
> **Version**: 2.0.0
|
|
4
|
+
> **Status**: Production
|
|
5
|
+
> **Purpose**: Define voice mapping formats across AgentVibes
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Multi-Provider Format (v2.0.0)
|
|
10
|
+
|
|
11
|
+
### Personality Voice Mapping
|
|
12
|
+
|
|
13
|
+
**Standard Format** (`.claude/personalities/*.md`):
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
---
|
|
17
|
+
name: sarcastic
|
|
18
|
+
description: Dry wit and cutting observations
|
|
19
|
+
voices:
|
|
20
|
+
elevenlabs: Jessica Anne Bogart
|
|
21
|
+
piper: en_US-amy-medium
|
|
22
|
+
---
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Fields:**
|
|
26
|
+
- `name` (required): Personality identifier
|
|
27
|
+
- `description` (optional): Human-readable description
|
|
28
|
+
- `voices` (required): Object with provider-specific voice names
|
|
29
|
+
- `elevenlabs`: ElevenLabs voice name
|
|
30
|
+
- `piper`: Piper voice model name
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Provider Override
|
|
35
|
+
|
|
36
|
+
Force a specific provider regardless of global setting:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
---
|
|
40
|
+
name: pirate
|
|
41
|
+
voices:
|
|
42
|
+
elevenlabs: Pirate Marshal
|
|
43
|
+
piper: en_GB-northern_english_male-medium
|
|
44
|
+
provider: piper # Always use Piper for this personality
|
|
45
|
+
---
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Use Cases:**
|
|
49
|
+
- Pirate personality → Piper (for local, offline feel)
|
|
50
|
+
- Professional personality → ElevenLabs (for premium quality)
|
|
51
|
+
- Budget-conscious personalities → Piper
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Multilingual Voice Mapping
|
|
56
|
+
|
|
57
|
+
**Language-Specific Voices** (`.claude/language-voices.yaml`):
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
languages:
|
|
61
|
+
spanish:
|
|
62
|
+
code: es
|
|
63
|
+
name: Spanish
|
|
64
|
+
elevenlabs:
|
|
65
|
+
voice: Antoni
|
|
66
|
+
voice_id: ErXwobaYiN019PkySvjV
|
|
67
|
+
piper:
|
|
68
|
+
voice: es_ES-sharvard-medium
|
|
69
|
+
locale: es_ES
|
|
70
|
+
french:
|
|
71
|
+
code: fr
|
|
72
|
+
name: French
|
|
73
|
+
elevenlabs:
|
|
74
|
+
voice: Thomas
|
|
75
|
+
voice_id: GBv7mTt0atIp3Br8iCZE
|
|
76
|
+
piper:
|
|
77
|
+
voice: fr_FR-siwis-medium
|
|
78
|
+
locale: fr_FR
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## BMAD Plugin Format
|
|
84
|
+
|
|
85
|
+
**Agent Voice Table** (`.claude/plugins/bmad-voices.md`):
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
| Agent ID | Agent Name | ElevenLabs Voice | Piper Voice | Personality |
|
|
89
|
+
|----------|------------|------------------|-------------|-------------|
|
|
90
|
+
| pm | John (Product Manager) | Jessica Anne Bogart | en_US-lessac-medium | professional |
|
|
91
|
+
| dev | James (Developer) | Matthew Schmitz | en_US-joe-medium | normal |
|
|
92
|
+
| qa | Quinn (QA) | Burt Reynolds | en_US-ryan-high | professional |
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Columns:**
|
|
96
|
+
- `Agent ID`: Must match BMAD's `agent.id` field
|
|
97
|
+
- `Agent Name`: Display name (reference only)
|
|
98
|
+
- `ElevenLabs Voice`: Voice name for ElevenLabs provider
|
|
99
|
+
- `Piper Voice`: Voice model for Piper provider (e.g., `en_US-lessac-medium`)
|
|
100
|
+
- `Personality`: Optional personality to apply
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Backward Compatibility
|
|
105
|
+
|
|
106
|
+
### Old Single-Voice Format (v1.0.0 - Deprecated)
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
---
|
|
110
|
+
name: sarcastic
|
|
111
|
+
voice: Jessica Anne Bogart
|
|
112
|
+
---
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Behavior**: Automatically treated as `voices.elevenlabs: Jessica Anne Bogart`
|
|
116
|
+
|
|
117
|
+
**Migration**: Add `piper` voice to enable multi-provider support:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
---
|
|
121
|
+
name: sarcastic
|
|
122
|
+
voices:
|
|
123
|
+
elevenlabs: Jessica Anne Bogart # From old 'voice:' field
|
|
124
|
+
piper: en_US-amy-medium # Add this
|
|
125
|
+
---
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Validation Rules
|
|
131
|
+
|
|
132
|
+
1. ✅ `voices` must be an object with provider keys
|
|
133
|
+
2. ✅ At least one provider voice must be specified
|
|
134
|
+
3. ✅ `provider` override must match available provider (`elevenlabs`/`piper`)
|
|
135
|
+
4. ✅ Voice names must exist in provider's voice library
|
|
136
|
+
5. ✅ Multilingual mappings should specify both providers (fallback to English if missing)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Complete Examples
|
|
141
|
+
|
|
142
|
+
### Minimal Personality
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
---
|
|
146
|
+
name: minimal
|
|
147
|
+
voices:
|
|
148
|
+
elevenlabs: Clyde
|
|
149
|
+
piper: en_US-ryan-high
|
|
150
|
+
---
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Complete Personality with All Features
|
|
154
|
+
|
|
155
|
+
```yaml
|
|
156
|
+
---
|
|
157
|
+
name: professional
|
|
158
|
+
description: Clear, articulate, and authoritative
|
|
159
|
+
voices:
|
|
160
|
+
elevenlabs: Brian
|
|
161
|
+
piper: en_US-danny-low
|
|
162
|
+
provider: elevenlabs # Force ElevenLabs for premium quality
|
|
163
|
+
sentiment: neutral
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
# Professional Personality
|
|
167
|
+
|
|
168
|
+
## AI Instructions
|
|
169
|
+
Use formal, corporate language. Be precise and businesslike.
|
|
170
|
+
|
|
171
|
+
## Example Responses
|
|
172
|
+
- "Initiating repository status assessment per your request"
|
|
173
|
+
- "Issue identified and resolved according to debugging best practices"
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Provider-Locked Personality
|
|
177
|
+
|
|
178
|
+
```yaml
|
|
179
|
+
---
|
|
180
|
+
name: premium-quality
|
|
181
|
+
description: Uses only highest-quality provider
|
|
182
|
+
voices:
|
|
183
|
+
elevenlabs: Jeremy
|
|
184
|
+
piper: en_US-libritts-high
|
|
185
|
+
provider: elevenlabs # Always use ElevenLabs regardless of global setting
|
|
186
|
+
---
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Voice Name References
|
|
192
|
+
|
|
193
|
+
### ElevenLabs Voices
|
|
194
|
+
|
|
195
|
+
Use voice display names from ElevenLabs Voice Library:
|
|
196
|
+
- `Aria`, `Brian`, `Clyde`, `Jessica Anne Bogart`, `Pirate Marshal`, etc.
|
|
197
|
+
- See: `/agent-vibes:list` or [ElevenLabs Voice Library](https://elevenlabs.io/app/voice-library)
|
|
198
|
+
|
|
199
|
+
### Piper Voices
|
|
200
|
+
|
|
201
|
+
Use Piper voice model names (format: `{language}_{locale}-{name}-{quality}`):
|
|
202
|
+
- `en_US-amy-medium`, `en_US-lessac-medium`, `en_GB-northern_english_male-medium`
|
|
203
|
+
- See: [Piper Voices Repository](https://huggingface.co/rhasspy/piper-voices)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Learn More
|
|
208
|
+
|
|
209
|
+
- **Provider Architecture**: [docs/architecture/provider-system.md](architecture/provider-system.md)
|
|
210
|
+
- **Provider Setup**: [docs/providers/](providers/)
|
|
211
|
+
- **Troubleshooting**: [docs/troubleshooting.md](troubleshooting.md)
|
|
212
|
+
|
|
213
|
+
**Questions?** Visit [agentvibes.org/support](https://agentvibes.org/support)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
**Last Updated**: 2025-01-05
|
|
218
|
+
**Version**: 2.0.0
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "agentvibes",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.6",
|
|
5
5
|
"description": "Bring your Claude Code sessions to life with voice! Professional TTS narration with multi-provider support.",
|
|
6
6
|
"homepage": "https://agentvibes.org",
|
|
7
7
|
"keywords": [
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# 🎤 Piper TTS Installation for AgentVibes
|
|
2
|
+
|
|
3
|
+
This directory contains installation scripts for [Piper TTS](https://github.com/rhasspy/piper), a fast, local neural text-to-speech system.
|
|
4
|
+
|
|
5
|
+
## Why Piper?
|
|
6
|
+
|
|
7
|
+
- ✅ **100% Free** - No API costs, ever
|
|
8
|
+
- ✅ **Offline** - Works without internet connection
|
|
9
|
+
- ✅ **Cross-platform** - Windows, macOS, Linux
|
|
10
|
+
- ✅ **High Quality** - Comparable to Google TTS
|
|
11
|
+
- ✅ **Fast** - Even runs on Raspberry Pi
|
|
12
|
+
- ✅ **No Rate Limits** - Generate unlimited audio
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### For WSL (Windows Subsystem for Linux)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Run the installation script
|
|
20
|
+
./scripts/piper-voice/wsl-install.sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**What it does:**
|
|
24
|
+
1. Installs Python dependencies (pipx)
|
|
25
|
+
2. Installs Piper TTS via pipx
|
|
26
|
+
3. Downloads English US voice (medium quality, ~20MB)
|
|
27
|
+
4. Tests the installation
|
|
28
|
+
5. Provides usage examples
|
|
29
|
+
|
|
30
|
+
**Requirements:**
|
|
31
|
+
- WSL2 (Ubuntu/Debian-based)
|
|
32
|
+
- Internet connection (for initial download)
|
|
33
|
+
- ~50MB disk space
|
|
34
|
+
|
|
35
|
+
### Manual Installation
|
|
36
|
+
|
|
37
|
+
If you prefer manual installation or need a different platform:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Install via pipx
|
|
41
|
+
pipx install piper-tts
|
|
42
|
+
|
|
43
|
+
# Download voices manually
|
|
44
|
+
mkdir -p ~/.local/share/piper/voices
|
|
45
|
+
cd ~/.local/share/piper/voices
|
|
46
|
+
|
|
47
|
+
# Download a voice from HuggingFace
|
|
48
|
+
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx
|
|
49
|
+
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
### Basic Usage
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Generate speech to file
|
|
58
|
+
echo "Hello from Piper!" | piper \
|
|
59
|
+
--model ~/.local/share/piper/voices/en_US-lessac-medium.onnx \
|
|
60
|
+
--output_file output.wav
|
|
61
|
+
|
|
62
|
+
# Play immediately (WSL)
|
|
63
|
+
echo "Hello from Piper!" | piper \
|
|
64
|
+
--model ~/.local/share/piper/voices/en_US-lessac-medium.onnx \
|
|
65
|
+
--output_file - | paplay
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### With AgentVibes
|
|
69
|
+
|
|
70
|
+
Integration with AgentVibes is coming soon! This will allow you to:
|
|
71
|
+
- Use Piper as an alternative to ElevenLabs
|
|
72
|
+
- Switch between providers with `/agent-vibes:provider`
|
|
73
|
+
- Save on API costs while maintaining quality
|
|
74
|
+
|
|
75
|
+
## Available Voices
|
|
76
|
+
|
|
77
|
+
Browse and download voices from:
|
|
78
|
+
- **HuggingFace**: https://huggingface.co/rhasspy/piper-voices/tree/v1.0.0
|
|
79
|
+
- **Samples**: https://rhasspy.github.io/piper-samples/
|
|
80
|
+
|
|
81
|
+
### Recommended Voices
|
|
82
|
+
|
|
83
|
+
**English (US):**
|
|
84
|
+
- `en_US-lessac-medium` - Clear, natural (included in install script)
|
|
85
|
+
- `en_US-amy-medium` - Warm, friendly
|
|
86
|
+
- `en_US-libritts-high` - Highest quality
|
|
87
|
+
|
|
88
|
+
**Other Languages:**
|
|
89
|
+
- Spanish: `es_ES-sharvard-medium`
|
|
90
|
+
- French: `fr_FR-siwis-medium`
|
|
91
|
+
- German: `de_DE-thorsten-medium`
|
|
92
|
+
- Italian: `it_IT-riccardo-medium`
|
|
93
|
+
|
|
94
|
+
### Quality Levels
|
|
95
|
+
|
|
96
|
+
- `x_low` - 16kHz, ~5-7MB - Fast, lower quality
|
|
97
|
+
- `low` - 16kHz, ~15-20MB - Good balance
|
|
98
|
+
- `medium` - 22.05kHz, ~15-20MB - **Recommended**
|
|
99
|
+
- `high` - 22.05kHz, ~28-32MB - Best quality
|
|
100
|
+
|
|
101
|
+
## Troubleshooting
|
|
102
|
+
|
|
103
|
+
### Command not found: piper
|
|
104
|
+
|
|
105
|
+
Add pipx bin directory to PATH:
|
|
106
|
+
```bash
|
|
107
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
108
|
+
# Add to ~/.bashrc or ~/.zshrc to make permanent
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### No audio output
|
|
112
|
+
|
|
113
|
+
Install audio utilities:
|
|
114
|
+
```bash
|
|
115
|
+
# For WSL
|
|
116
|
+
sudo apt-get install pulseaudio-utils
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Voice download fails
|
|
120
|
+
|
|
121
|
+
- Check internet connection
|
|
122
|
+
- Verify HuggingFace is accessible
|
|
123
|
+
- Try alternative mirror or manual download
|
|
124
|
+
|
|
125
|
+
## Performance
|
|
126
|
+
|
|
127
|
+
**Benchmark (WSL2 on modern laptop):**
|
|
128
|
+
- Generation speed: ~10-20x real-time
|
|
129
|
+
- Latency: ~100-200ms for short phrases
|
|
130
|
+
- Memory: ~50-100MB per voice model
|
|
131
|
+
|
|
132
|
+
## Links
|
|
133
|
+
|
|
134
|
+
- **Piper GitHub**: https://github.com/rhasspy/piper
|
|
135
|
+
- **Voice Samples**: https://rhasspy.github.io/piper-samples/
|
|
136
|
+
- **HuggingFace Models**: https://huggingface.co/rhasspy/piper-voices
|
|
137
|
+
- **AgentVibes Discussion**: https://github.com/paulpreibisch/AgentVibes/discussions/24
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
Piper TTS is licensed under the MIT License.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
**Need help?** Open an issue at https://github.com/paulpreibisch/AgentVibes/issues
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# WSL Installation Script for Piper TTS
|
|
3
|
+
# A fast, local neural text-to-speech system for offline voice generation
|
|
4
|
+
# Author: AgentVibes Team
|
|
5
|
+
# License: Apache-2.0
|
|
6
|
+
# Version: 1.1.3
|
|
7
|
+
|
|
8
|
+
set -e # Exit on error
|
|
9
|
+
|
|
10
|
+
# Color codes
|
|
11
|
+
CYAN='\033[0;36m'
|
|
12
|
+
MAGENTA='\033[0;35m'
|
|
13
|
+
ORANGE='\033[0;33m'
|
|
14
|
+
GREEN='\033[0;32m'
|
|
15
|
+
GRAY='\033[0;90m'
|
|
16
|
+
NC='\033[0m' # No Color
|
|
17
|
+
|
|
18
|
+
# Clear screen for better presentation
|
|
19
|
+
clear
|
|
20
|
+
|
|
21
|
+
# AgentVibes Banner (smaller version)
|
|
22
|
+
echo -e "${CYAN}"
|
|
23
|
+
cat << "EOF"
|
|
24
|
+
_ _ __ ___ _
|
|
25
|
+
/_\ __ _ ___ _ _ _| |_\ \ / (_)| |__ ___ ___
|
|
26
|
+
/ _ \/ _` |/ -_) ' \| _|\ V /| || '_ \/ -_)(_-<
|
|
27
|
+
/_/ \_\__, |\___|_||_|\__| \_/ |_||_.__/\___//__/
|
|
28
|
+
|___/
|
|
29
|
+
EOF
|
|
30
|
+
echo -e "${NC}"
|
|
31
|
+
|
|
32
|
+
# Piper Installation Banner (orange)
|
|
33
|
+
echo -e "${ORANGE}"
|
|
34
|
+
cat << "EOF"
|
|
35
|
+
╔═══════════════════════════════════════════════════════╗
|
|
36
|
+
║ ║
|
|
37
|
+
║ 🎵 Piper Sound Installation Script 🎵 ║
|
|
38
|
+
║ ║
|
|
39
|
+
║ Fast • Local • Free Neural Text-to-Speech ║
|
|
40
|
+
║ ║
|
|
41
|
+
╚═══════════════════════════════════════════════════════╝
|
|
42
|
+
EOF
|
|
43
|
+
echo -e "${NC}"
|
|
44
|
+
echo -e "${GRAY}Version: 1.1.3${NC}"
|
|
45
|
+
echo ""
|
|
46
|
+
|
|
47
|
+
echo -e "${GRAY}This script will install:${NC}"
|
|
48
|
+
echo -e " ${GREEN}•${NC} Piper TTS (neural text-to-speech system)"
|
|
49
|
+
echo -e " ${GREEN}•${NC} English US voice (medium quality - ~20MB)"
|
|
50
|
+
echo -e " ${GREEN}•${NC} All required dependencies"
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
# Check if running in WSL
|
|
54
|
+
if ! grep -qi microsoft /proc/version; then
|
|
55
|
+
echo -e "${ORANGE}⚠️ Warning: This doesn't appear to be WSL${NC}"
|
|
56
|
+
echo -e "${GRAY} This script is designed for WSL (Windows Subsystem for Linux)${NC}"
|
|
57
|
+
read -p " Continue anyway? (y/N): " -n 1 -r
|
|
58
|
+
echo
|
|
59
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# Check if running as root
|
|
65
|
+
if [[ $EUID -eq 0 ]]; then
|
|
66
|
+
echo -e "${ORANGE}❌ Error: Do not run this script as root (no sudo)${NC}"
|
|
67
|
+
echo -e "${GRAY} The script will ask for sudo when needed${NC}"
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
echo -e "${CYAN}📦 Step 1: Installing system dependencies...${NC}"
|
|
72
|
+
echo -e "${GRAY} This requires sudo access${NC}"
|
|
73
|
+
sudo apt-get update
|
|
74
|
+
sudo apt-get install -y python3-pip python3-venv pipx
|
|
75
|
+
|
|
76
|
+
echo ""
|
|
77
|
+
echo -e "${CYAN}🔧 Step 2: Configuring pipx...${NC}"
|
|
78
|
+
pipx ensurepath
|
|
79
|
+
|
|
80
|
+
# Add to shell config files if not already present
|
|
81
|
+
if [ -f "$HOME/.bashrc" ] && ! grep -q '$HOME/.local/bin' "$HOME/.bashrc"; then
|
|
82
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.bashrc"
|
|
83
|
+
echo -e "${GRAY} Added to ~/.bashrc${NC}"
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
if [ -f "$HOME/.zshrc" ] && ! grep -q '$HOME/.local/bin' "$HOME/.zshrc"; then
|
|
87
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.zshrc"
|
|
88
|
+
echo -e "${GRAY} Added to ~/.zshrc${NC}"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Source the updated PATH for current session
|
|
92
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
93
|
+
|
|
94
|
+
echo ""
|
|
95
|
+
echo -e "${CYAN}⬇️ Step 3: Installing Piper TTS...${NC}"
|
|
96
|
+
pipx install piper-tts
|
|
97
|
+
|
|
98
|
+
echo ""
|
|
99
|
+
echo -e "${CYAN}📂 Step 4: Creating voice directory...${NC}"
|
|
100
|
+
VOICE_DIR="$HOME/.local/share/piper/voices"
|
|
101
|
+
mkdir -p "$VOICE_DIR"
|
|
102
|
+
|
|
103
|
+
echo ""
|
|
104
|
+
echo -e "${CYAN}🗣️ Step 5: Downloading English US voice (medium quality)...${NC}"
|
|
105
|
+
echo -e "${GRAY} Voice: en_US-lessac-medium (~20MB)${NC}"
|
|
106
|
+
echo -e "${GRAY} Source: HuggingFace (rhasspy/piper-voices)${NC}"
|
|
107
|
+
|
|
108
|
+
cd "$VOICE_DIR"
|
|
109
|
+
|
|
110
|
+
# Download voice model
|
|
111
|
+
if [ ! -f "en_US-lessac-medium.onnx" ]; then
|
|
112
|
+
echo -e "${GRAY} Downloading model file...${NC}"
|
|
113
|
+
wget -q --show-progress \
|
|
114
|
+
https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx \
|
|
115
|
+
-O en_US-lessac-medium.onnx
|
|
116
|
+
else
|
|
117
|
+
echo -e "${GREEN} ✓ Model file already exists${NC}"
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
# Download voice config
|
|
121
|
+
if [ ! -f "en_US-lessac-medium.onnx.json" ]; then
|
|
122
|
+
echo -e "${GRAY} Downloading config file...${NC}"
|
|
123
|
+
wget -q --show-progress \
|
|
124
|
+
https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json \
|
|
125
|
+
-O en_US-lessac-medium.onnx.json
|
|
126
|
+
else
|
|
127
|
+
echo -e "${GREEN} ✓ Config file already exists${NC}"
|
|
128
|
+
fi
|
|
129
|
+
|
|
130
|
+
echo ""
|
|
131
|
+
echo -e "${CYAN}🧪 Step 6: Testing Piper installation...${NC}"
|
|
132
|
+
TEST_FILE="/tmp/piper-test-$(date +%s).wav"
|
|
133
|
+
|
|
134
|
+
echo -e "${GRAY} Generating test audio...${NC}"
|
|
135
|
+
echo "Well, hi there, Piper! Installation successful. We hope you have fun with AgentVibes." | \
|
|
136
|
+
~/.local/bin/piper --model "$VOICE_DIR/en_US-lessac-medium.onnx" \
|
|
137
|
+
--output_file "$TEST_FILE"
|
|
138
|
+
|
|
139
|
+
if [ -f "$TEST_FILE" ]; then
|
|
140
|
+
echo -e "${GREEN} ✓ Audio file generated successfully${NC}"
|
|
141
|
+
|
|
142
|
+
# Try to play the audio
|
|
143
|
+
if command -v paplay &> /dev/null; then
|
|
144
|
+
echo -e "${GRAY} Playing test audio with paplay...${NC}"
|
|
145
|
+
paplay "$TEST_FILE" 2>/dev/null || echo -e "${ORANGE} ⚠️ Could not play audio (but file was generated)${NC}"
|
|
146
|
+
elif command -v aplay &> /dev/null; then
|
|
147
|
+
echo -e "${GRAY} Playing test audio with aplay...${NC}"
|
|
148
|
+
aplay "$TEST_FILE" 2>/dev/null || echo -e "${ORANGE} ⚠️ Could not play audio (but file was generated)${NC}"
|
|
149
|
+
else
|
|
150
|
+
echo -e "${ORANGE} ⚠️ No audio player found (paplay/aplay), but audio file was generated${NC}"
|
|
151
|
+
echo -e "${GRAY} Install pulseaudio-utils: sudo apt-get install pulseaudio-utils${NC}"
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
rm -f "$TEST_FILE"
|
|
155
|
+
else
|
|
156
|
+
echo -e "${ORANGE} ❌ Error: Failed to generate test audio${NC}"
|
|
157
|
+
exit 1
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
echo ""
|
|
161
|
+
echo -e "${GREEN}"
|
|
162
|
+
cat << "EOF"
|
|
163
|
+
╔═══════════════════════════════════════════════════════╗
|
|
164
|
+
║ ║
|
|
165
|
+
║ ✅ Installation Complete! ✅ ║
|
|
166
|
+
║ ║
|
|
167
|
+
╚═══════════════════════════════════════════════════════╝
|
|
168
|
+
EOF
|
|
169
|
+
echo -e "${NC}"
|
|
170
|
+
|
|
171
|
+
echo -e "${CYAN}📍 Installation Details:${NC}"
|
|
172
|
+
echo -e "${GRAY} Piper binary: ~/.local/bin/piper${NC}"
|
|
173
|
+
echo -e "${GRAY} Voice directory: $VOICE_DIR${NC}"
|
|
174
|
+
echo -e "${GRAY} Default voice: en_US-lessac-medium${NC}"
|
|
175
|
+
echo ""
|
|
176
|
+
echo -e "${CYAN}🎯 Quick Usage:${NC}"
|
|
177
|
+
echo -e "${GRAY} # Generate speech from text${NC}"
|
|
178
|
+
echo -e " ${GREEN}echo \"Hello world\" | piper --model $VOICE_DIR/en_US-lessac-medium.onnx --output_file output.wav${NC}"
|
|
179
|
+
echo ""
|
|
180
|
+
echo -e "${GRAY} # Play immediately${NC}"
|
|
181
|
+
echo -e " ${GREEN}echo \"Hello world\" | piper --model $VOICE_DIR/en_US-lessac-medium.onnx --output_file - | paplay${NC}"
|
|
182
|
+
echo ""
|
|
183
|
+
echo -e "${CYAN}📚 Additional Voices:${NC}"
|
|
184
|
+
echo -e "${GRAY} Browse available voices at:${NC}"
|
|
185
|
+
echo -e " ${MAGENTA}https://huggingface.co/rhasspy/piper-voices/tree/v1.0.0${NC}"
|
|
186
|
+
echo ""
|
|
187
|
+
echo -e "${GRAY} Download more voices to: ${GREEN}$VOICE_DIR${NC}"
|
|
188
|
+
echo ""
|
|
189
|
+
echo -e "${CYAN}🔗 Next Steps:${NC}"
|
|
190
|
+
echo -e " ${GREEN}•${NC} Test Piper: ${GRAY}echo \"Test\" | piper --model $VOICE_DIR/en_US-lessac-medium.onnx --output_file - | paplay${NC}"
|
|
191
|
+
echo -e " ${GREEN}•${NC} Download more voices from HuggingFace"
|
|
192
|
+
echo -e " ${GREEN}•${NC} Integrate with AgentVibes (coming soon!)"
|
|
193
|
+
echo ""
|