Spaces:
Sleeping
Sleeping
# Define the path for the audio file in the /mnt/data/ directory
Browse filesaudio_path = "/mnt/data/generated_audio_openai.mp3"
# Save the audio stream to a file in the /mnt/data/ directory
with open(audio_path, "wb") as audio_file:
audio_file.write(response.data)
app.py
CHANGED
@@ -271,11 +271,12 @@ def paragraph_save_and_tts(paragraph_text):
|
|
271 |
input=paragraph_text,
|
272 |
)
|
273 |
|
274 |
-
# Define the path for the audio file
|
275 |
-
audio_path = "generated_audio_openai.mp3"
|
276 |
|
277 |
-
# Save the audio stream to a file
|
278 |
-
|
|
|
279 |
|
280 |
# Return the path to the audio file along with the text
|
281 |
return paragraph_text, audio_path
|
|
|
271 |
input=paragraph_text,
|
272 |
)
|
273 |
|
274 |
+
# Define the path for the audio file in the /mnt/data/ directory
|
275 |
+
audio_path = "/mnt/data/generated_audio_openai.mp3"
|
276 |
|
277 |
+
# Save the audio stream to a file in the /mnt/data/ directory
|
278 |
+
with open(audio_path, "wb") as audio_file:
|
279 |
+
audio_file.write(response.data)
|
280 |
|
281 |
# Return the path to the audio file along with the text
|
282 |
return paragraph_text, audio_path
|