Update audio2text/a2t.py
Browse files- 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":
|
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"
|