Omnibus commited on
Commit
a8e72fd
1 Parent(s): 1cb3525

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -43,6 +43,7 @@ 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):
@@ -83,14 +84,14 @@ with gr.Blocks() as app:
83
  with gr.Tab("Upload"):
84
  with gr.Row():
85
  in_aud_mic = gr.Audio(source='microphone')
86
- in_aud_file = gr.Audio(source='upload')
87
  aud_file = gr.File()
88
  with gr.Row():
89
  in_aud_yt = gr.Textbox(label="YouTube URL")
90
  load_yt_btn = gr.Button("Load URL")
91
  with gr.Row():
92
  trim_clip_btn = gr.Button("Trim Clip")
93
- trim_aud = gr.Audio(source='upload')
94
  yt_vid = gr.Video(type = 'filepath')
95
  trim_vid=gr.Video()
96
  alt_go_btn = gr.Button()
 
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
+ print (yt.length)
47
  return vid, vid_aud, "tmp_aud.mp4"
48
 
49
  def trim_clip(clip):
 
84
  with gr.Tab("Upload"):
85
  with gr.Row():
86
  in_aud_mic = gr.Audio(source='microphone')
87
+ in_aud_file = gr.Audio(source='upload', interactive = True)
88
  aud_file = gr.File()
89
  with gr.Row():
90
  in_aud_yt = gr.Textbox(label="YouTube URL")
91
  load_yt_btn = gr.Button("Load URL")
92
  with gr.Row():
93
  trim_clip_btn = gr.Button("Trim Clip")
94
+ trim_aud = gr.Audio(source='upload', interactive = False)
95
  yt_vid = gr.Video(type = 'filepath')
96
  trim_vid=gr.Video()
97
  alt_go_btn = gr.Button()