Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import midi_util
|
|
5 |
from midi_util import VocabConfig
|
6 |
import tempfile
|
7 |
from glob import glob
|
8 |
-
import
|
9 |
from midi2audio import FluidSynth
|
10 |
fs = FluidSynth()
|
11 |
def gen(piano_only, length):
|
@@ -32,6 +32,6 @@ with gr.Blocks() as demo:
|
|
32 |
synth.click(gen, inputs=[piano_only, length], outputs=[txtout, fileout, audioout])
|
33 |
with gr.Accordion("Samples", open=False):
|
34 |
for i, audpath in enumerate(glob("*.wav")):
|
35 |
-
|
36 |
-
gr.Audio(interactive=False, value=(sr,
|
37 |
demo.queue(api_open=False).launch(show_api=False)
|
|
|
5 |
from midi_util import VocabConfig
|
6 |
import tempfile
|
7 |
from glob import glob
|
8 |
+
import librosa
|
9 |
from midi2audio import FluidSynth
|
10 |
fs = FluidSynth()
|
11 |
def gen(piano_only, length):
|
|
|
32 |
synth.click(gen, inputs=[piano_only, length], outputs=[txtout, fileout, audioout])
|
33 |
with gr.Accordion("Samples", open=False):
|
34 |
for i, audpath in enumerate(glob("*.wav")):
|
35 |
+
y, sr = librosa.load(filename)
|
36 |
+
gr.Audio(interactive=False, value=(y,sr,), label=f'Sample {i + 1}')
|
37 |
demo.queue(api_open=False).launch(show_api=False)
|