Athspi commited on
Commit
9b50ef3
·
verified ·
1 Parent(s): 489a7ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import gradio as gr
5
  import torch
6
  import os
7
  from faster_whisper import WhisperModel
8
- from moviepy import editor # Updated import
9
 
10
  # Define the model and device
11
  MODEL_NAME = "Systran/faster-whisper-large-v3"
@@ -37,7 +37,7 @@ SUPPORTED_LANGUAGES = [
37
 
38
  def extract_audio_from_video(video_file):
39
  """Extract audio from a video file and save it as a WAV file."""
40
- video = editor.VideoFileClip(video_file)
41
  audio_file = "extracted_audio.wav"
42
  video.audio.write_audiofile(audio_file, fps=16000)
43
  return audio_file
 
5
  import torch
6
  import os
7
  from faster_whisper import WhisperModel
8
+ from moviepy.video.io.VideoFileClip import VideoFileClip # Updated import
9
 
10
  # Define the model and device
11
  MODEL_NAME = "Systran/faster-whisper-large-v3"
 
37
 
38
  def extract_audio_from_video(video_file):
39
  """Extract audio from a video file and save it as a WAV file."""
40
+ video = VideoFileClip(video_file)
41
  audio_file = "extracted_audio.wav"
42
  video.audio.write_audiofile(audio_file, fps=16000)
43
  return audio_file