Omnibus commited on
Commit
194d529
1 Parent(s): 8ba3782

Update vc.py

Browse files
Files changed (1) hide show
  1. vc.py +5 -2
vc.py CHANGED
@@ -42,7 +42,10 @@ def trim_clip(clip, start_t, end_t):
42
  print("New Audio file is created and saved")
43
 
44
  return f"{uid}-trim.wav"
45
-
 
 
 
46
  with gr.Blocks() as app:
47
  with gr.Box():
48
  with gr.Row():
@@ -71,7 +74,7 @@ with gr.Blocks() as app:
71
 
72
 
73
 
74
-
75
  load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
76
  trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
77
  alt_go_btn.click(custom_bark, [in_text,in_aud_file,trim_aud, in_aud_mic], out_audio)
 
42
  print("New Audio file is created and saved")
43
 
44
  return f"{uid}-trim.wav"
45
+ def pre_aud(inp):
46
+ song = AudioSegment.from_file(Path(f'{inp}', format="mp4"))
47
+ song.export(f"{uid}-tmp_aud.mp4", format="mp4")
48
+
49
  with gr.Blocks() as app:
50
  with gr.Box():
51
  with gr.Row():
 
74
 
75
 
76
 
77
+ in_aud_file.change(pre_aud,in_aud_file,None)
78
  load_yt_btn.click(load_video_yt, in_aud_yt, [yt_vid,in_aud_file,aud_file])
79
  trim_clip_btn.click(trim_clip,[aud_file, start_time, end_time],trim_aud)
80
  alt_go_btn.click(custom_bark, [in_text,in_aud_file,trim_aud, in_aud_mic], out_audio)