awacke1 commited on
Commit
7840580
·
1 Parent(s): 48b0926

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -71,9 +71,8 @@ def transcribe_audio(openai_key, file_path, model):
71
  st.error("Error in API call.")
72
  return None
73
 
74
-
75
  # Updated to call direct from transcription to chat inference.
76
- save_and_play_audio(audio_recorder):
77
  audio_bytes = audio_recorder()
78
  if audio_bytes:
79
  filename = generate_filename("Recording", "wav")
@@ -81,7 +80,7 @@ save_and_play_audio(audio_recorder):
81
  f.write(audio_bytes)
82
  st.audio(audio_bytes, format="audio/wav")
83
  return filename
84
- USEAUDIO=True
85
  if USEAUDIO:
86
  if st.sidebar.checkbox('Use Audio Input'):
87
  filename = save_and_play_audio(audio_recorder)
 
71
  st.error("Error in API call.")
72
  return None
73
 
 
74
  # Updated to call direct from transcription to chat inference.
75
+ def save_and_play_audio(audio_recorder):
76
  audio_bytes = audio_recorder()
77
  if audio_bytes:
78
  filename = generate_filename("Recording", "wav")
 
80
  f.write(audio_bytes)
81
  st.audio(audio_bytes, format="audio/wav")
82
  return filename
83
+ USEAUDIO=False
84
  if USEAUDIO:
85
  if st.sidebar.checkbox('Use Audio Input'):
86
  filename = save_and_play_audio(audio_recorder)