kevinwang676 commited on
Commit
608f12c
·
verified ·
1 Parent(s): eeca2c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -395,14 +395,24 @@ restart_markdown = ("""
395
 
396
  import ffmpeg
397
 
 
 
 
 
398
  def denoise(input_files):
399
  delete_sliced_files("./", "input_video")
400
 
401
  #if os.path.exists("audio_full.wav"):
402
  # os.remove("audio_full.wav")
403
  for video_file in input_files:
 
 
 
 
 
 
404
 
405
- ffmpeg.input(video_file.name).output("input_video" + video_file.name + ".wav", ac=2, ar=44100).run()
406
 
407
  zip_sliced_files("./", "转换后的音频.zip", "input_video")
408
 
 
395
 
396
  import ffmpeg
397
 
398
+ def save_file_with_new_name(original_file_path, new_file_path):
399
+ shutil.copyfile(original_file_path, new_file_path)
400
+
401
+
402
  def denoise(input_files):
403
  delete_sliced_files("./", "input_video")
404
 
405
  #if os.path.exists("audio_full.wav"):
406
  # os.remove("audio_full.wav")
407
  for video_file in input_files:
408
+
409
+ name1 = video_file.name
410
+ file_name_with_extension = name1.split('/')[-1]
411
+ file_name1 = file_name_with_extension.split('.mp4')[0] + ".wav"
412
+
413
+ save_file_with_new_name(video_file.name, file_name1)
414
 
415
+ ffmpeg.input(file_name1).output("input_video" + file_name1 + ".wav", ac=2, ar=44100).run()
416
 
417
  zip_sliced_files("./", "转换后的音频.zip", "input_video")
418