Spaces:
Running
on
Zero
Running
on
Zero
jadechoghari
commited on
Commit
•
3aaf62a
1
Parent(s):
8bbfb83
update
Browse files
app.py
CHANGED
@@ -26,8 +26,13 @@ def generate_waveform(description):
|
|
26 |
|
27 |
generated_file_path = "./awesome.wav"
|
28 |
|
|
|
|
|
|
|
|
|
29 |
if os.path.exists(generated_file_path):
|
30 |
-
|
|
|
31 |
else:
|
32 |
return "Error: Failed to generate the waveform."
|
33 |
|
@@ -54,7 +59,8 @@ Note: The music generation process will take 1-2 minutes 🎶
|
|
54 |
iface = gr.Interface(
|
55 |
fn=generate_waveform,
|
56 |
inputs=gr.Textbox(lines=2, placeholder="Enter a music description here..."),
|
57 |
-
outputs=gr.Audio(label="Download the Music 🎼"),
|
|
|
58 |
description=intro,
|
59 |
examples=[
|
60 |
["A modern synthesizer creating futuristic soundscapes."],
|
|
|
26 |
|
27 |
generated_file_path = "./awesome.wav"
|
28 |
|
29 |
+
# if os.path.exists(generated_file_path):
|
30 |
+
# return generated_file_path
|
31 |
+
# else:
|
32 |
+
# return "Error: Failed to generate the waveform."
|
33 |
if os.path.exists(generated_file_path):
|
34 |
+
waveform_video = gr.make_waveform(audio=generated_file_path, bg_color="#000000", bars_color="#00FF00", bar_count=100, bar_width=1.5)
|
35 |
+
return waveform_video
|
36 |
else:
|
37 |
return "Error: Failed to generate the waveform."
|
38 |
|
|
|
59 |
iface = gr.Interface(
|
60 |
fn=generate_waveform,
|
61 |
inputs=gr.Textbox(lines=2, placeholder="Enter a music description here..."),
|
62 |
+
# outputs=gr.Audio(label="Download the Music 🎼"),
|
63 |
+
outputs=gr.Video(label="Watch the Waveform 🎼"),
|
64 |
description=intro,
|
65 |
examples=[
|
66 |
["A modern synthesizer creating futuristic soundscapes."],
|