Spaces:
Build error
Build error
Delete app.py
Browse files
app.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import librosa
|
| 3 |
-
import soundfile as sf
|
| 4 |
-
import numpy as np
|
| 5 |
-
|
| 6 |
-
def convert(source, target):
|
| 7 |
-
src, sr = librosa.load(source, sr=44100)
|
| 8 |
-
tgt, sr = librosa.load(target, sr=44100)
|
| 9 |
-
|
| 10 |
-
length = min(len(src), len(tgt))
|
| 11 |
-
out = (src[:length] + tgt[:length]) / 2
|
| 12 |
-
|
| 13 |
-
output = "output.wav"
|
| 14 |
-
sf.write(output, out, 44100)
|
| 15 |
-
|
| 16 |
-
return output
|
| 17 |
-
|
| 18 |
-
with gr.Blocks() as demo:
|
| 19 |
-
gr.Markdown("# Voice Converter")
|
| 20 |
-
|
| 21 |
-
src = gr.Audio(type="filepath", label="Source Audio")
|
| 22 |
-
tgt = gr.Audio(type="filepath", label="Target Audio")
|
| 23 |
-
|
| 24 |
-
btn = gr.Button("Convert")
|
| 25 |
-
|
| 26 |
-
out = gr.Audio()
|
| 27 |
-
|
| 28 |
-
btn.click(convert, inputs=[src, tgt], outputs=out)
|
| 29 |
-
|
| 30 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|