Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -191,12 +191,11 @@ def save_audio_data_to_file(audio_data, directory="audio_files", filename="outpu
|
|
191 |
"""
|
192 |
Save audio data to a file and return the file path.
|
193 |
"""
|
194 |
-
|
195 |
file_path = os.path.join(directory, filename)
|
196 |
with open(file_path, 'wb') as file:
|
197 |
file.write(audio_data)
|
198 |
return file_path
|
199 |
-
|
200 |
# Ensure the function that reads the audio file checks if the path is a file
|
201 |
def read_audio_file(file_path):
|
202 |
"""
|
|
|
191 |
"""
|
192 |
Save audio data to a file and return the file path.
|
193 |
"""
|
194 |
+
os.makedirs(directory, exist_ok=True)
|
195 |
file_path = os.path.join(directory, filename)
|
196 |
with open(file_path, 'wb') as file:
|
197 |
file.write(audio_data)
|
198 |
return file_path
|
|
|
199 |
# Ensure the function that reads the audio file checks if the path is a file
|
200 |
def read_audio_file(file_path):
|
201 |
"""
|