better tts config for worker

This commit is contained in:
michael 2025-10-08 18:47:28 -05:00
parent 2f90da34c9
commit c2ed1429c9
2 changed files with 6 additions and 4 deletions

View file

@ -12,11 +12,13 @@ logger = get_logger(__name__)
class TTSService:
def __init__(self):
# Initialize Google TTS
if settings.google_tts_credentials:
# Initialize Google TTS (uses GOOGLE_APPLICATION_CREDENTIALS env var)
# The same GCP credentials used for GCS also work for TTS
try:
self.google_client = texttospeech.TextToSpeechClient()
else:
logger.warning("Google TTS credentials not configured")
logger.info("Google TTS client initialized successfully")
except Exception as e:
logger.warning(f"Google TTS credentials not configured: {e}")
self.google_client = None
# Check ElevenLabs availability