hagenw commited on
Commit
4b3a974
1 Parent(s): f6665ab
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -105,9 +105,10 @@ def process_func(x: np.ndarray, sampling_rate: int) -> dict:
105
  def recognize(input_microphone, input_file):
106
  if input_microphone:
107
  sampling_rate, signal = input_microphone
 
108
  elif input_file:
109
  signal, sampling_rate = audiofile.read(file, duration=duration)
110
- else::
111
  raise gr.Error(
112
  "No audio file submitted! "
113
  "Please upload or record an audio file "
 
105
  def recognize(input_microphone, input_file):
106
  if input_microphone:
107
  sampling_rate, signal = input_microphone
108
+ signal = signal.astype(np.float32, order="C") / 32768.0
109
  elif input_file:
110
  signal, sampling_rate = audiofile.read(file, duration=duration)
111
+ else:
112
  raise gr.Error(
113
  "No audio file submitted! "
114
  "Please upload or record an audio file "