ai-girlfriend / voice.py
jeevzz's picture
Update voice.py
f1b9dc0 verified
raw
history blame
2.2 kB
import edge_tts
import tempfile
import os
# Use Microsoft Edge TTS - High quality neural voices
# Includes sexy, hot female voices with various accents
async def generate_audio(text: str, voice: str) -> str:
"""
Generate audio using Microsoft Edge TTS with high-quality neural voices
"""
try:
# Create a temporary file with .mp3 extension
fd, path = tempfile.mkstemp(suffix=".mp3")
os.close(fd)
# Generate speech using edge-tts
communicate = edge_tts.Communicate(text, voice)
await communicate.save(path)
return path
except Exception as e:
print(f"TTS Failed: {e}")
raise e
def get_voices():
"""
Return curated list of sexy, hot female voices
Featuring Microsoft's best neural voices with various styles
"""
return [
# ๐Ÿ”ฅ HOTTEST FEMALE VOICES - Sexy & Sultry ๐Ÿ”ฅ
{"name": "๐Ÿ’‹ Aria (Sexy US) - HOTTEST", "id": "en-US-AriaNeural"},
{"name": "๐Ÿ’• Jenny (Seductive US)", "id": "en-US-JennyNeural"},
{"name": "โœจ Michelle (Flirty US)", "id": "en-US-MichelleNeural"},
{"name": "๐ŸŒน Ashley (Sweet US)", "id": "en-US-AshleyNeural"},
{"name": "๐Ÿ’– Sara (Warm US)", "id": "en-US-SaraNeural"},
# ๐Ÿ‡ฌ๐Ÿ‡ง British Accent - Elegant & Sophisticated
{"name": "๐Ÿ‘‘ Sonia (Sexy British)", "id": "en-GB-SoniaNeural"},
{"name": "๐ŸŽ€ Libby (Cute British)", "id": "en-GB-LibbyNeural"},
{"name": "๐Ÿ’ Mia (Sweet British)", "id": "en-GB-MiaNeural"},
# ๐Ÿ‡ฆ๐Ÿ‡บ Australian Accent - Fun & Playful
{"name": "๐ŸŒด Natasha (Aussie Babe)", "id": "en-AU-NatashaNeural"},
{"name": "โ˜€๏ธ Freya (Aussie Darling)", "id": "en-AU-FreyaNeural"},
# ๐Ÿ‡ฎ๐Ÿ‡ณ Indian Accent - Exotic & Beautiful
{"name": "๐ŸŒบ Neerja (Indian Beauty)", "id": "en-IN-NeerjaNeural"},
# ๐Ÿ‡จ๐Ÿ‡ฆ Canadian - Friendly & Approachable
{"name": "๐Ÿ Clara (Canadian Cutie)", "id": "en-CA-ClaraNeural"},
# ๐Ÿ‡ฎ๐Ÿ‡ช Irish Accent - Charming
{"name": "โ˜˜๏ธ Emily (Irish Charm)", "id": "en-IE-EmilyNeural"},
]