CineAI commited on
Commit
0ce306d
1 Parent(s): 26ee134

Update audio2text/a2t.py

Browse files
Files changed (1) hide show
  1. audio2text/a2t.py +2 -2
audio2text/a2t.py CHANGED
@@ -28,12 +28,12 @@ class A2T:
28
  chunk = np.array(chunk)
29
  audio = self.__preprocces(chunk)
30
  sampling_rate = self.mic.frame_rate
31
- print(f"audio : {audio} \n frame_rate : {sampling_rate}")
32
  else:
33
  return "please provide audio"
34
 
35
  if isinstance(audio , np.ndarray):
36
- inputs = {"sampling_rate": sampling_rate, "raw": audio}
37
  return self.__transcribe(inputs=inputs, task=TASK)
38
  else:
39
  return "Audio is not np array"
 
28
  chunk = np.array(chunk)
29
  audio = self.__preprocces(chunk)
30
  sampling_rate = self.mic.frame_rate
31
+ print(f"audio : {audio} \n frame_rate : {sampling_rate} shape : {audio.shape}")
32
  else:
33
  return "please provide audio"
34
 
35
  if isinstance(audio , np.ndarray):
36
+ inputs = {"sampling_rate": 16_000, "raw": audio}
37
  return self.__transcribe(inputs=inputs, task=TASK)
38
  else:
39
  return "Audio is not np array"