Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# app.py
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from pipeline import voice_to_voice
|
| 4 |
+
|
| 5 |
+
with gr.Blocks() as app:
|
| 6 |
+
gr.Markdown("## Voice to Voice AI (Free + Open Source)")
|
| 7 |
+
|
| 8 |
+
audio_input = gr.Audio(
|
| 9 |
+
sources=["microphone", "upload"], # microphone + upload fallback
|
| 10 |
+
type="filepath",
|
| 11 |
+
label="Speak or Upload"
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
text_output = gr.Textbox(label="AI Text Reply")
|
| 15 |
+
audio_output = gr.Audio(label="AI Voice Reply")
|
| 16 |
+
|
| 17 |
+
btn = gr.Button("Talk")
|
| 18 |
+
|
| 19 |
+
btn.click(
|
| 20 |
+
fn=voice_to_voice,
|
| 21 |
+
inputs=audio_input,
|
| 22 |
+
outputs=[text_output, audio_output]
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
app.launch()
|