SohomToom commited on
Commit
90a97f4
·
verified ·
1 Parent(s): 96c6f9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -164,18 +164,18 @@ def generate_audio(docx_file, speaker_label):
164
  except Exception as e:
165
  print("Generation interrupted. Saving partial output.", e)
166
 
167
- output_dir = tempfile.mkdtemp()
168
- final_output_path = os.path.join(output_dir, "final_output.wav")
169
- combined_audio.export(final_output_path, format="wav")
170
 
171
- zip_path = os.path.join(output_dir, "output.zip")
172
- with zipfile.ZipFile(zip_path, 'w') as zipf:
173
- zipf.write(final_output_path, arcname="final_output.wav")
174
 
175
- for f in temp_files:
176
- os.remove(f)
177
 
178
- return zip_path
179
 
180
  # --- UI ---
181
  speaker_choices = list_speaker_choices()
 
164
  except Exception as e:
165
  print("Generation interrupted. Saving partial output.", e)
166
 
167
+ output_dir = tempfile.mkdtemp()
168
+ final_output_path = os.path.join(output_dir, "final_output.wav")
169
+ combined_audio.export(final_output_path, format="wav")
170
 
171
+ zip_path = os.path.join(output_dir, "output.zip")
172
+ with zipfile.ZipFile(zip_path, 'w') as zipf:
173
+ zipf.write(final_output_path, arcname="final_output.wav")
174
 
175
+ for f in temp_files:
176
+ os.remove(f)
177
 
178
+ return zip_path
179
 
180
  # --- UI ---
181
  speaker_choices = list_speaker_choices()