Ahsen Khaliq commited on
Commit
676cdad
1 Parent(s): 0272252

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import librosa
2
+ import gradio as gr
3
+ import pedalboard
4
+ import soundfile as sf
5
+
6
+ def inference(audio):
7
+ y, sr = librosa.load(audio.name, sr=44100)
8
+
9
+ reverb = pedalboard.Reverb()
10
+ reverb
11
+ reverb.room_size
12
+ reverb.wet_level = 1.0
13
+ effected = reverb(y, sample_rate=sr)
14
+ with sf.SoundFile('./processed-output-stereo.wav', 'w', samplerate=sr, channels=len(effected.shape)) as f:
15
+ f.write(effected)
16
+ return './processed-output-stereo.wav'
17
+
18
+
19
+ inputs = gr.inputs.Audio(label="Input Audio", type="file")
20
+ outputs = gr.outputs.Audio(label="Output Audio", type="file")
21
+
22
+
23
+ title = "VITS"
24
+ description = "demo for VITS: Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
25
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2106.06103'>Conditional Variational Autoencoder with Adversarial Learning for End-to-End Text-to-Speech</a> | <a href='https://github.com/jaywalnut310/vits'>Github Repo</a></p>"
26
+
27
+
28
+ gr.Interface(inference, inputs, outputs, title=title, description=description, article=article).launch(debug=True)