Update playht tts service

This commit is contained in:
Moishe Lettvin
2024-02-14 12:16:48 -05:00
parent cc7877f626
commit 97a4cb8b7f
2 changed files with 23 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ import os
from dailyai.services.daily_transport_service import DailyTransportService
from dailyai.services.elevenlabs_ai_service import ElevenLabsTTSService
from dailyai.services.playht_ai_service import PlayHTAIService
from examples.foundational.support.runner import configure
@@ -26,10 +27,17 @@ async def main(room_url):
meeting_duration_minutes,
mic_enabled=True
)
"""
tts = ElevenLabsTTSService(
aiohttp_session=session,
api_key=os.getenv("ELEVENLABS_API_KEY"),
voice_id=os.getenv("ELEVENLABS_VOICE_ID"))
"""
tts = PlayHTAIService(
api_key=os.getenv("PLAY_HT_API_KEY"),
user_id=os.getenv("PLAY_HT_USER_ID"),
voice_url=os.getenv("PLAY_HT_VOICE_URL"),
)
# Register an event handler so we can play the audio when the participant joins.
@transport.event_handler("on_participant_joined")