mrfakename commited on
Commit
1c0e7d7
·
verified ·
1 Parent(s): b1aa982

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 soundfile as sf
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
- sr, dat = sf.read(audpath)
36
- gr.Audio(interactive=False, value=(sr,dat,), label=f'Sample {i + 1}')
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)