Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,15 +42,15 @@ def run_bark(text, n, lang):
|
|
42 |
def load_video_yt(vid):
|
43 |
yt = YouTube(vid)
|
44 |
vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename="tmp.mp4")
|
45 |
-
vid_aud = yt.streams.filter(only_audio=True)[0].download(filename="tmp_aud.
|
46 |
-
return vid, vid_aud, "tmp_aud.
|
47 |
|
48 |
def trim_clip(clip):
|
49 |
-
clip = Path("tmp_aud.
|
50 |
#clip = "tmp_aud.mp3"
|
51 |
# Open an mp3 file
|
52 |
-
song = AudioSegment.from_file("tmp_aud.
|
53 |
-
format="
|
54 |
|
55 |
# start and end time
|
56 |
start_min = 0
|
|
|
42 |
def load_video_yt(vid):
|
43 |
yt = YouTube(vid)
|
44 |
vid = yt.streams.filter(progressive=True, file_extension='mp4').order_by('resolution').desc().first().download(filename="tmp.mp4")
|
45 |
+
vid_aud = yt.streams.filter(only_audio=True)[0].download(filename="tmp_aud.mp4")
|
46 |
+
return vid, vid_aud, "tmp_aud.mp4"
|
47 |
|
48 |
def trim_clip(clip):
|
49 |
+
clip = Path("tmp_aud.mp4")
|
50 |
#clip = "tmp_aud.mp3"
|
51 |
# Open an mp3 file
|
52 |
+
song = AudioSegment.from_file("tmp_aud.mp4",
|
53 |
+
format="mp4")
|
54 |
|
55 |
# start and end time
|
56 |
start_min = 0
|