Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,9 @@ def get_menu_items(sf):
|
|
| 51 |
def generate_audio_prompt(text, filename):
|
| 52 |
try:
|
| 53 |
tts = gTTS(text)
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
except gtts.tts.gTTSError as e:
|
| 56 |
print(f"Error: {e}")
|
| 57 |
print("Retrying after 5 seconds...")
|
|
|
|
| 51 |
def generate_audio_prompt(text, filename):
|
| 52 |
try:
|
| 53 |
tts = gTTS(text)
|
| 54 |
+
file_path = os.path.join("static", filename)
|
| 55 |
+
tts.save(file_path)
|
| 56 |
+
print(f"Audio saved to {file_path}") # Log the saved file path
|
| 57 |
except gtts.tts.gTTSError as e:
|
| 58 |
print(f"Error: {e}")
|
| 59 |
print("Retrying after 5 seconds...")
|