Omnibus commited on
Commit
29cf60d
1 Parent(s): 6f7e937

Update vc.py

Browse files
Files changed (1) hide show
  1. vc.py +7 -7
vc.py CHANGED
@@ -45,10 +45,10 @@ def trim_clip(clip, start_t, end_t):
45
  return f"{uid}-trim.wav"
46
  def pre_aud(inp):
47
  print(inp)
48
- song = AudioSegment.from_file(Path(f'{inp}'), format="mp4")
49
- song.export(f"{uid}-tmp_aud.mp4", format="mp4")
50
- print(f'pre_aud:: {f"{uid}-tmp_aud.mp4"}')
51
- return f"{uid}-tmp_aud.mp4"
52
  with gr.Blocks() as app:
53
  with gr.Group():
54
  with gr.Row():
@@ -69,7 +69,7 @@ with gr.Blocks() as app:
69
  start_time = gr.Textbox(label = "Start", value = "0:00", placeholder = "0:23")
70
  end_time = gr.Textbox(label = "End", value = "0:01", placeholder = "1:12")
71
  trim_clip_btn = gr.Button("Trim Clip")
72
- #trim_aud = gr.Audio(label = 'Trimmed Audio Source', sources='upload', interactive = False)
73
  with gr.Column():
74
  in_aud_yt = gr.Textbox(label="YouTube URL")
75
  load_yt_btn = gr.Button("Load URL")
@@ -77,9 +77,9 @@ with gr.Blocks() as app:
77
 
78
 
79
 
80
- #in_aud_file.change(pre_aud,in_aud_file,aud_file)
81
  load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
82
- #trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
83
  alt_go_btn.click(custom_bark, [in_text,in_aud_file], out_audio)
84
 
85
  app.launch()
 
45
  return f"{uid}-trim.wav"
46
  def pre_aud(inp):
47
  print(inp)
48
+ #song = AudioSegment.from_file(Path(f'{inp}'), format="mp4")
49
+ #song.export(f"{uid}-tmp_aud.mp4", format="mp4")
50
+ #print(f'pre_aud:: {f"{uid}-tmp_aud.mp4"}')
51
+ return inp
52
  with gr.Blocks() as app:
53
  with gr.Group():
54
  with gr.Row():
 
69
  start_time = gr.Textbox(label = "Start", value = "0:00", placeholder = "0:23")
70
  end_time = gr.Textbox(label = "End", value = "0:01", placeholder = "1:12")
71
  trim_clip_btn = gr.Button("Trim Clip")
72
+ trim_aud = gr.Audio(label = 'Trimmed Audio Source', sources=['upload'], interactive = False)
73
  with gr.Column():
74
  in_aud_yt = gr.Textbox(label="YouTube URL")
75
  load_yt_btn = gr.Button("Load URL")
 
77
 
78
 
79
 
80
+ in_aud_file.change(pre_aud,in_aud_file,aud_file)
81
  load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
82
+ trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
83
  alt_go_btn.click(custom_bark, [in_text,in_aud_file], out_audio)
84
 
85
  app.launch()