CineAI commited on
Commit
26ee134
·
verified ·
1 Parent(s): f05c13f

Update audio2text/a2t.py

Browse files
Files changed (1) hide show
  1. audio2text/a2t.py +4 -2
audio2text/a2t.py CHANGED
@@ -27,12 +27,14 @@ class A2T:
27
  chunk = self.mic.get_array_of_samples()
28
  chunk = np.array(chunk)
29
  audio = self.__preprocces(chunk)
30
- print("audio : ", audio)
 
31
  else:
32
  return "please provide audio"
33
 
34
  if isinstance(audio , np.ndarray):
35
- return self.__transcribe(inputs=audio, task=TASK)
 
36
  else:
37
  return "Audio is not np array"
38
 
 
27
  chunk = self.mic.get_array_of_samples()
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"
40