vsj0702 commited on
Commit
2b08886
·
verified ·
1 Parent(s): cd314a9
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -19,6 +19,10 @@ def frontend():
19
  status_placeholder = st.empty()
20
  status_placeholder.write("Press Mic button to start asking question")
21
  recorded_audio = audio_recorder()
 
 
 
 
22
  if recorded_audio:
23
  status_placeholder.write("Converting audio ...")
24
  data_to_file(recorded_audio)
@@ -70,4 +74,5 @@ synthesiser = pipeline("text-to-speech", "suno/bark")
70
 
71
  speech = synthesiser("Hello, my dog is cooler than you!", forward_params={"do_sample": True})
72
 
73
- scipy.io.wavfile.write("bark_out.wav", rate=speech["sampling_rate"], data=speech["audio"])
 
 
19
  status_placeholder = st.empty()
20
  status_placeholder.write("Press Mic button to start asking question")
21
  recorded_audio = audio_recorder()
22
+ transcription = audio_to_text("bark_out.wav")
23
+ response = answer(transcription)
24
+ st.write("Q:" + transcription)
25
+ st.write("A: " + response)
26
  if recorded_audio:
27
  status_placeholder.write("Converting audio ...")
28
  data_to_file(recorded_audio)
 
74
 
75
  speech = synthesiser("Hello, my dog is cooler than you!", forward_params={"do_sample": True})
76
 
77
+ scipy.io.wavfile.write("bark_out.wav", rate=speech["sampling_rate"], data=speech["audio"])
78
+ frontend()