MingGatsby commited on
Commit
6653e08
1 Parent(s): 2c00ad9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -33,9 +33,8 @@ def extract_audio(video_path):
33
  base_video_path, _ = os.path.splitext(video_path)
34
  audio_path = f"{base_video_path}.mp3"
35
  clip = VideoFileClip(video_path)
36
- clip.audio.write_audiofile(filename=audio_path, codec="mp3", bitrate="32k")
37
- # Remove the line that closes the audio
38
- clip.close()
39
  return audio_path
40
 
41
  def process_video(video_path, seconds_per_frame=2):
 
33
  base_video_path, _ = os.path.splitext(video_path)
34
  audio_path = f"{base_video_path}.mp3"
35
  clip = VideoFileClip(video_path)
36
+ clip.audio.write_audiofile(audio_path, bitrate="32k")
37
+ clip.audio.close()
 
38
  return audio_path
39
 
40
  def process_video(video_path, seconds_per_frame=2):