muhammadshaheryar commited on
Commit
443dd85
·
verified ·
1 Parent(s): cd0493e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -46,21 +46,21 @@ def voice_to_voice_chat(audio_file):
46
 
47
  # Step 3: Text-to-speech (TTS)
48
  response_audio_path = text_to_speech(response_text)
49
-
50
- return response_text, response_audio_path
51
-
52
- # Gradio interface
53
  interface = gr.Interface(
54
  fn=voice_to_voice_chat,
55
- inputs=gr.Audio(source="microphone", type="file"),
56
  outputs=[
57
  "text", # Transcription and response text
58
- "audio" # TTS-generated audio output
59
  ],
60
- live=True,
61
- title="Real-Time Voice-to-Voice Chatbot",
62
- description="Speak to interact with the chatbot. It transcribes your speech, processes it with Groq LLM, and responds with synthesized speech.",
63
  )
64
 
 
 
 
 
65
  # Launch Gradio app
66
  interface.launch()
 
46
 
47
  # Step 3: Text-to-speech (TTS)
48
  response_audio_path = text_to_speech(response_text)
49
+ gr.Audio(type="filepath")
50
+ gr.Audio(type="numpy")
 
 
51
  interface = gr.Interface(
52
  fn=voice_to_voice_chat,
53
+ inputs=gr.Audio(type="filepath"), # Corrected type
54
  outputs=[
55
  "text", # Transcription and response text
56
+ gr.Audio(type="filepath"), # Generated audio response as a file path
57
  ],
58
+ live=True # Ensure real-time interaction
 
 
59
  )
60
 
61
+
62
+
63
+
64
+
65
  # Launch Gradio app
66
  interface.launch()