File size: 677 Bytes
57fb1f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# app.py
import gradio as gr
from pipeline import voice_to_voice

with gr.Blocks(title="Voice to Voice AI Assistant") as demo:
    gr.Markdown("## 🎙️ Voice to Voice AI Assistant")
    gr.Markdown("Speak → AI thinks → AI speaks back")

    audio_input = gr.Audio(
        sources=["microphone"],
        type="filepath",
        label="Speak Here"
    )

    audio_output = gr.Audio(
        type="filepath",
        label="AI Voice Response"
    )

    text_output = gr.Textbox(label="AI Text Response")

    btn = gr.Button("Run")

    btn.click(
        fn=voice_to_voice,
        inputs=audio_input,
        outputs=[audio_output, text_output],
    )

demo.launch()