Update audio2text/a2t.py
Browse files- 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 |
-
|
|
|
31 |
else:
|
32 |
return "please provide audio"
|
33 |
|
34 |
if isinstance(audio , np.ndarray):
|
35 |
-
|
|
|
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 |
|