Spaces:
Running
Running
UPDATE
Browse files
app.py
CHANGED
@@ -21,46 +21,16 @@ def process_audio(input_file,
|
|
21 |
sound = Fusion.effectSlowed(sound, speed_multiplier)
|
22 |
effect_str.append("Slowed")
|
23 |
if effect_reverb:
|
24 |
-
sound = Fusion.effectReverb(sound, room_size, damping, width, wet_level, dry_level,
|
25 |
effect_str.append("Reverb")
|
26 |
|
27 |
output_file = f"{input_file} {' + '.join(effects_str)} - {'By AudioFusion'}"
|
28 |
|
29 |
# Save the processed sound and return the output file
|
30 |
-
output = Fusion.saveSound(sound, output_file
|
31 |
return output
|
32 |
|
33 |
|
34 |
-
|
35 |
-
# iface = gr.Interface(
|
36 |
-
# fn=process_audio,
|
37 |
-
# inputs=[
|
38 |
-
# gr.Audio(label="Upload your music file", type="filepath"),
|
39 |
-
|
40 |
-
# # 8d Effect and its arguments
|
41 |
-
# gr.Checkbox(label="Apply 8D effect"),
|
42 |
-
# gr.Slider(label="8D - Pan Boundary", minimum=0, maximum=100, value=100),
|
43 |
-
# gr.Slider(label="8D - Jump Percentage", minimum=1, maximum=100, value=5),
|
44 |
-
# gr.Slider(label="8D - Time L to R (s)", minimum=1, maximum=30, value=10),
|
45 |
-
# gr.Slider(label="8D - Volume Multiplier", minimum=1, maximum=20, value=6),
|
46 |
-
|
47 |
-
# # SLowed Effect and its arguments
|
48 |
-
# gr.Checkbox(label="Apply slowed effect"),
|
49 |
-
# gr.Slider(label="Slowed - Speed Multiplier", minimum=0.1, maximum=4, step=0.01, value=0.92),
|
50 |
-
|
51 |
-
# # Reverb Effect and its arguments
|
52 |
-
# gr.Checkbox(label="Apply reverb effect"),
|
53 |
-
# gr.Slider(label="Reverb - Room Size", minimum=0, maximum=2, step=0.01, value=0.8),
|
54 |
-
# gr.Slider(label="Reverb - Damping", minimum=0, maximum=2, value=1),
|
55 |
-
# gr.Slider(label="Reverb - Width", minimum=0, maximum=2, step=0.1, value=0.5),
|
56 |
-
# gr.Slider(label="Reverb - Wet Level", minimum=0, maximum=2, step=0.1, value=0.3),
|
57 |
-
# gr.Slider(label="Reverb - Dry Level", minimum=0, maximum=2, step=0.1, value=0.8),
|
58 |
-
# ],
|
59 |
-
# outputs=gr.Audio(label="Download processed music", type="filepath"),
|
60 |
-
# title="Audio Fusion"
|
61 |
-
# )
|
62 |
-
|
63 |
-
|
64 |
with gr.Blocks(title="Audio Fusion") as iface:
|
65 |
gr.Markdown("<p align='center'><h1>Audio Fusion</h1></p>")
|
66 |
input_audio = gr.Audio(label="Upload your music file", type="filepath")
|
@@ -118,7 +88,7 @@ with gr.Blocks(title="Audio Fusion") as iface:
|
|
118 |
inputs = [input_audio, dimension_check, pan, jump, time, volx, speed_check, speed, reverb_check, room, damp, width, wet, dry]
|
119 |
output = [gr.Audio(label="Download processed music", type="filepath")]
|
120 |
|
121 |
-
btn = gr.Button("Run", size="sm")
|
122 |
btn.click(fn=process_audio, inputs=inputs, outputs=output, api_name="AudioFusion")
|
123 |
|
124 |
iface.launch(share=False)
|
|
|
21 |
sound = Fusion.effectSlowed(sound, speed_multiplier)
|
22 |
effect_str.append("Slowed")
|
23 |
if effect_reverb:
|
24 |
+
sound = Fusion.effectReverb(sound, room_size, damping, width, wet_level, dry_level, str(secrets.token_hex(5)))
|
25 |
effect_str.append("Reverb")
|
26 |
|
27 |
output_file = f"{input_file} {' + '.join(effects_str)} - {'By AudioFusion'}"
|
28 |
|
29 |
# Save the processed sound and return the output file
|
30 |
+
output = Fusion.saveSound(sound, output_file)
|
31 |
return output
|
32 |
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
with gr.Blocks(title="Audio Fusion") as iface:
|
35 |
gr.Markdown("<p align='center'><h1>Audio Fusion</h1></p>")
|
36 |
input_audio = gr.Audio(label="Upload your music file", type="filepath")
|
|
|
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)
|