Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
redfernstech
/
s
like
0
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
3076331
s
/
gtts_utils.py
redfernstech
Upload 6 files
e8a4c92
verified
9 months ago
raw
Copy download link
history
blame
Safe
235 Bytes
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