File size: 2,315 Bytes
abc9157 | 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 | #!/usr/bin/env python3
"""
Check which ElevenLabs voices are available to you.
Run this with: python check_voices.py YOUR_API_KEY
"""
import sys
from elevenlabs import ElevenLabs
if len(sys.argv) < 2:
print("Usage: python check_voices.py YOUR_ELEVENLABS_API_KEY")
sys.exit(1)
api_key = sys.argv[1]
client = ElevenLabs(api_key=api_key)
print("\n=== Available Voices in Your Account ===\n")
try:
voices = client.voices.get_all()
print(f"Total voices available: {len(voices.voices)}\n")
for voice in voices.voices:
# Check if it's likely a premade/stock voice
is_premade = hasattr(voice, 'category') and voice.category == 'premade'
voice_type = "STOCK" if is_premade else "CUSTOM"
print(f" [{voice_type}] {voice.name}")
print(f" ID: {voice.voice_id}")
if hasattr(voice, 'labels'):
labels = ', '.join([f"{k}: {v}" for k, v in voice.labels.items()])
print(f" Labels: {labels}")
print()
print("\n=== Checking voices in your config.py ===\n")
config_voices = {
"mixtape": "H10ItvDnkRN5ysrvzT9J",
"angry_boss": "TxWZERZ5Hc6h9dGxVmXa",
"sarcastic": "FGY2WhTYpPnrIDTdsKH5",
"disappointed_parent": "Xb7hH8MSUJpSbSDYk0k2",
"motivational_coach": "IKne3meq5aSn9XLyUdCD",
"absurdist": "cgSgspJ2msm6clMCkdW9",
"corporate_ai": "weA4Q36twV5kwSaTEL0Q",
"british_butler": "JBFqnCBsd6RMkjVDRZzb"
}
all_voice_ids = [v.voice_id for v in voices.voices]
problems_found = False
for personality, vid in config_voices.items():
if vid in all_voice_ids:
voice = next(v for v in voices.voices if v.voice_id == vid)
print(f" ✓ {personality}: {voice.name} ({vid})")
else:
print(f" ✗ {personality}: {vid} - NOT AVAILABLE!")
problems_found = True
if problems_found:
print("\n⚠️ Some voices in your config are NOT available to your account.")
print(" You need to replace them with voices you have access to.")
print(" Use the voice IDs from the list above.")
else:
print("\n✓ All config voices are available!")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
|