fffiloni commited on
Commit
f4675b5
1 Parent(s): 293b33a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -15
app.py CHANGED
@@ -77,21 +77,10 @@ def process_image(image_in):
77
  return result
78
 
79
  def extract_audio(video_path):
80
- # Open the video clip and extract the audio stream
81
- audio = VideoFileClip(video_path).audio
82
-
83
- # Set the output file path and format
84
- output_path = 'output_audio.wav'
85
-
86
- # Write the audio stream to disk using the AAC codec
87
- audio.write_audiofile(output_path, codec='aac')
88
-
89
- # Confirm that the audio file was written successfully
90
- if os.path.exists(output_path):
91
- print(f'Successfully wrote audio to {output_path}.')
92
- return output_path
93
- else:
94
- raise FileNotFoundError(f'Failed to write audio to {output_path}.')
95
 
96
  def get_salmonn(audio_in):
97
  salmonn_prompt = "Please list each event in the audio in order."
 
77
  return result
78
 
79
  def extract_audio(video_path):
80
+ video_clip = VideoFileClip(video_path)
81
+ audio_clip = video_clip.audio
82
+ audio_clip.write_audiofile("output_audio.mp3")
83
+ return "output_audio.mp3"
 
 
 
 
 
 
 
 
 
 
 
84
 
85
  def get_salmonn(audio_in):
86
  salmonn_prompt = "Please list each event in the audio in order."