Spaces:
Sleeping
Sleeping
bartman081523
commited on
Commit
·
1fc17fc
1
Parent(s):
6671fe4
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,8 @@ def convert_to_wav(data, sample_rate):
|
|
59 |
|
60 |
return temp_file
|
61 |
|
62 |
-
def download_wav(
|
|
|
63 |
temp_file = convert_to_wav(data, sample_rate)
|
64 |
shutil.move(temp_file, "download.wav")
|
65 |
return "download.wav"
|
@@ -75,7 +76,7 @@ iface = gr.Interface(
|
|
75 |
],
|
76 |
[
|
77 |
gr.outputs.Audio(label="Generated Vinyl Sound", type="numpy"),
|
78 |
-
gr.outputs.Button(label="Download Vinyl Sound", type="auto"
|
79 |
],
|
80 |
title="Vinyl Sound Generator",
|
81 |
description="Generate a synthetic vinyl sound using pink noise, rumble, hiss, and pops. Adjust the noise ratio, bandpass frequencies, duration, and pop rate to modify the sound.",
|
@@ -86,4 +87,4 @@ iface = gr.Interface(
|
|
86 |
]
|
87 |
)
|
88 |
|
89 |
-
iface.launch()
|
|
|
59 |
|
60 |
return temp_file
|
61 |
|
62 |
+
def download_wav():
|
63 |
+
data, sample_rate = generate_vinyl_sound(0.001, 300, 5000, 10, 10)
|
64 |
temp_file = convert_to_wav(data, sample_rate)
|
65 |
shutil.move(temp_file, "download.wav")
|
66 |
return "download.wav"
|
|
|
76 |
],
|
77 |
[
|
78 |
gr.outputs.Audio(label="Generated Vinyl Sound", type="numpy"),
|
79 |
+
gr.outputs.Button(label="Download Vinyl Sound", type="auto")
|
80 |
],
|
81 |
title="Vinyl Sound Generator",
|
82 |
description="Generate a synthetic vinyl sound using pink noise, rumble, hiss, and pops. Adjust the noise ratio, bandpass frequencies, duration, and pop rate to modify the sound.",
|
|
|
87 |
]
|
88 |
)
|
89 |
|
90 |
+
iface.launch(download_button=download_wav)
|