Spaces:
Runtime error
Runtime error
from gtts import gTTS | |
import os | |
import uuid | |
def generate_speech(text: str) -> str: | |
file_name = f"{uuid.uuid4()}.mp3" | |
file_path = f"audio/{file_name}" | |
tts = gTTS(text) | |
tts.save(file_path) | |
return file_path | |