Spaces:
Running
Running
Update app.py
Browse files
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
|
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 =
|
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
|