zarox commited on
Commit
6546294
·
1 Parent(s): f580a70
Files changed (1) hide show
  1. app.py +22 -13
app.py CHANGED
@@ -39,10 +39,12 @@ with gr.Blocks(title="Audio Fusion") as iface:
39
  with gr.Tab("8d Effect"):
40
  dimension_check = gr.Checkbox(label="Apply 8D effect")
41
  with gr.Column(visible=False) as di_col:
42
- pan = gr.Slider(label="8D - Pan Boundary", minimum=0, maximum=100, value=100)
43
- jump = gr.Slider(label="8D - Jump Percentage", minimum=1, maximum=100, value=5)
44
- time = gr.Slider(label="8D - Time L to R (s)", minimum=1, maximum=30, value=10)
45
- volx = gr.Slider(label="8D - Volume Multiplier", minimum=1, maximum=20, value=6)
 
 
46
 
47
  # SLowed Effect and its arguments
48
  with gr.Tab("Slowed Effect"):
@@ -54,11 +56,13 @@ with gr.Blocks(title="Audio Fusion") as iface:
54
  with gr.Tab("Reverb Effect"):
55
  reverb_check = gr.Checkbox(label="Apply reverb effect")
56
  with gr.Column(visible=False) as re_col:
57
- room = gr.Slider(label="Reverb - Room Size", minimum=0, maximum=2, step=0.01, value=0.8)
58
- damp = gr.Slider(label="Reverb - Damping", minimum=0, maximum=2, value=1)
59
- width = gr.Slider(label="Reverb - Width", minimum=0, maximum=2, step=0.1, value=0.5)
60
- wet = gr.Slider(label="Reverb - Wet Level", minimum=0, maximum=2, step=0.1, value=0.3)
61
- dry = gr.Slider(label="Reverb - Dry Level", minimum=0, maximum=2, step=0.1, value=0.8)
 
 
62
 
63
  # =====================================================
64
  def di_v(check):
@@ -84,11 +88,16 @@ with gr.Blocks(title="Audio Fusion") as iface:
84
  speed_check.change(se_v, inputs=[speed_check], outputs=[se_col])
85
  reverb_check.change(re_v, inputs=[reverb_check], outputs=[re_col])
86
  # =====================================================
 
 
 
 
 
87
 
88
- inputs = [input_audio, dimension_check, pan, jump, time, volx, speed_check, speed, reverb_check, room, damp, width, wet, dry]
89
  output = [gr.Audio(label="Download processed music", type="filepath")]
90
-
91
- btn = gr.Button("Run", size="sm", variant="primary")
92
- btn.click(fn=process_audio, inputs=inputs, outputs=output, api_name="AudioFusion")
93
 
94
  iface.launch(share=False)
 
39
  with gr.Tab("8d Effect"):
40
  dimension_check = gr.Checkbox(label="Apply 8D effect")
41
  with gr.Column(visible=False) as di_col:
42
+ with gr.Row():
43
+ pan = gr.Slider(label="8D - Pan Boundary", minimum=0, maximum=100, value=100)
44
+ jump = gr.Slider(label="8D - Jump Percentage", minimum=1, maximum=100, value=5)
45
+ with gr.Row():
46
+ time = gr.Slider(label="8D - Time L to R (s)", minimum=1, maximum=30, value=10)
47
+ volx = gr.Slider(label="8D - Volume Multiplier", minimum=1, maximum=20, value=6)
48
 
49
  # SLowed Effect and its arguments
50
  with gr.Tab("Slowed Effect"):
 
56
  with gr.Tab("Reverb Effect"):
57
  reverb_check = gr.Checkbox(label="Apply reverb effect")
58
  with gr.Column(visible=False) as re_col:
59
+ with gr.Row():
60
+ room = gr.Slider(label="Reverb - Room Size", minimum=0, maximum=1, step=0.01, value=0.8)
61
+ damp = gr.Slider(label="Reverb - Damping", minimum=0, maximum=1, step=0.05, value=1)
62
+ width = gr.Slider(label="Reverb - Width", minimum=0, maximum=1, step=0.05, value=0.5)
63
+ with gr.Row():
64
+ wet = gr.Slider(label="Reverb - Wet Level", minimum=0, maximum=1, step=0.05, value=0.3)
65
+ dry = gr.Slider(label="Reverb - Dry Level", minimum=0, maximum=1, step=0.05, value=0.8)
66
 
67
  # =====================================================
68
  def di_v(check):
 
88
  speed_check.change(se_v, inputs=[speed_check], outputs=[se_col])
89
  reverb_check.change(re_v, inputs=[reverb_check], outputs=[re_col])
90
  # =====================================================
91
+
92
+ components = [input_audio, dimension_check, pan, jump, time, volx, speed_check, speed, reverb_check, room, damp, width, wet, dry]
93
+ with gr.Row():
94
+ btnClear = gr.ClearButton(components=components)
95
+ btnRun = gr.Button("Run", size="sm", variant="primary")
96
 
97
+ inputs = components_
98
  output = [gr.Audio(label="Download processed music", type="filepath")]
99
+
100
+ btnClear.add(components=output)
101
+ btnRun.click(fn=process_audio, inputs=inputs, outputs=output, api_name="AudioFusion")
102
 
103
  iface.launch(share=False)