JacobLinCool commited on
Commit
417e4c2
1 Parent(s): a365fcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -19,15 +19,15 @@ def split(client, audio):
19
 
20
  @spaces.GPU
21
  def convert(rvc, vocal, pitch_modification):
 
22
  samples = rvc.convert(vocal, pitch_modification=pitch_modification)
23
- return samples
24
 
25
  def process_audio(client, model, audio, pitch_modification):
26
  vocal, bgm = split(client, audio)
27
- rvc = RVC.from_pretrained(model)
28
- samples = convert(rvc, vocal, pitch_modification)
29
 
30
- sf.write("vocal.wav", samples, rvc.sr)
31
 
32
  vocal = AudioSegment.from_wav("vocal.wav")
33
  background = AudioSegment.from_mp3(bgm)
 
19
 
20
  @spaces.GPU
21
  def convert(rvc, vocal, pitch_modification):
22
+ rvc = RVC.from_pretrained(model)
23
  samples = rvc.convert(vocal, pitch_modification=pitch_modification)
24
+ return samples, rvc.sr
25
 
26
  def process_audio(client, model, audio, pitch_modification):
27
  vocal, bgm = split(client, audio)
28
+ samples, sr = convert(model, vocal, pitch_modification)
 
29
 
30
+ sf.write("vocal.wav", samples, sr)
31
 
32
  vocal = AudioSegment.from_wav("vocal.wav")
33
  background = AudioSegment.from_mp3(bgm)