AlekseyKorshuk commited on
Commit
f04af8f
1 Parent(s): d94feec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  import uuid
7
  from midi2audio import FluidSynth
8
  import time
 
9
 
10
 
11
  def inference(audio, num_epoch):
@@ -19,8 +20,10 @@ def inference(audio, num_epoch):
19
  fs.midi_to_audio(audio.name, f'{name}-init.wav')
20
  time.sleep(2)
21
  print([f'{name}-init.wav', f'{name}.wav'])
22
- return [f'{name}-init.wav', f'{name}.wav']
23
-
 
 
24
 
25
  title = "Accompaniment Generator"
26
  description = "Gradio demo for MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling. To use it, simply upload your midi file, or click one of the examples to load them. Read more at the links below."
 
6
  import uuid
7
  from midi2audio import FluidSynth
8
  import time
9
+ from scipy.io import wavfile
10
 
11
 
12
  def inference(audio, num_epoch):
 
20
  fs.midi_to_audio(audio.name, f'{name}-init.wav')
21
  time.sleep(2)
22
  print([f'{name}-init.wav', f'{name}.wav'])
23
+ return [
24
+ wavfile.read(f'{name}-init.wav'),
25
+ wavfile.read(f'{name}.wav'),
26
+ ]
27
 
28
  title = "Accompaniment Generator"
29
  description = "Gradio demo for MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling. To use it, simply upload your midi file, or click one of the examples to load them. Read more at the links below."