Tonic commited on
Commit
099e1b4
1 Parent(s): ac0fcbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
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
- Path(directory).mkdir(parents=True, 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
-
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
  """