-
-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (63 loc) · 2.69 KB
/
Copy pathdomi-v3-human.yml
File metadata and controls
71 lines (63 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Domi v3 Human Voice Test
on:
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6.2.0
with:
python-version: "3.11"
- name: Generate Domi v3 samples with audio tags
env:
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
run: |
python3 << 'PYEOF'
import json, os, urllib.request
API = "https://api.elevenlabs.io"
KEY = os.environ["ELEVENLABS_API_KEY"]
DOMI_ID = "AZnzlk1XvdvUeBnXmlld"
# Research-backed settings for human-sounding short commands
SETTINGS = {"stability": 0.45, "similarity_boost": 0.73, "style": 0, "use_speaker_boost": True}
# v3 with audio tags for commanding delivery
PHRASES = {
"move_intense": "[intense] Move... with a PURPOSE!",
"no_hesitation_commanding": "[commanding] No hesitation. Move!",
"stay_shouting": "[shouting] Stay in the fight!",
"push_intense": "[intense] Push through! Don't you dare coast!",
"elapsed_serious": "[serious] Thirty seconds elapsed. Stay locked in.",
"move_excited": "[excited] Let's GO! Move with a purpose!",
"push_shouting": "[shouting] Push HARDER! You've got this!",
"reset_commanding": "[commanding] Reset... breathe... attack again!",
}
os.makedirs("/tmp/domi-v3", exist_ok=True)
for fname, text in PHRASES.items():
payload = {
"text": text,
"model_id": "eleven_v3",
"voice_settings": SETTINGS,
}
data = json.dumps(payload).encode()
req = urllib.request.Request(
f"{API}/v1/text-to-speech/{DOMI_ID}?output_format=mp3_44100_128",
data=data,
headers={"xi-api-key": KEY, "Content-Type": "application/json", "Accept": "audio/mpeg"},
)
path = f"/tmp/domi-v3/{fname}.mp3"
try:
with urllib.request.urlopen(req, timeout=60) as resp:
audio = resp.read()
with open(path, "wb") as f:
f.write(audio)
print(f"{fname}.mp3 ({len(audio)} bytes) — {text}")
except Exception as e:
print(f"FAILED {fname}: {e}")
print("\nDone! 8 samples with Eleven v3 + audio tags.")
PYEOF
- uses: actions/upload-artifact@v7
if: always()
with:
name: domi-v3-human-samples
path: /tmp/domi-v3/
retention-days: 1