Update audio2text/a2t.py
Browse files- audio2text/a2t.py +3 -2
audio2text/a2t.py
CHANGED
@@ -9,10 +9,10 @@ LIMIT = 90 # limit 90 seconds
|
|
9 |
class A2T:
|
10 |
def __init__(self, mic):
|
11 |
self.mic = mic
|
12 |
-
print(type(self.mic))
|
13 |
|
14 |
def __preprocces(self, audio, frame_rate):
|
15 |
try:
|
|
|
16 |
audio = audio / 32678.0
|
17 |
print("Audio div : ", audio)
|
18 |
|
@@ -40,7 +40,8 @@ class A2T:
|
|
40 |
|
41 |
def predict(self):
|
42 |
if self.mic is not None:
|
43 |
-
audio = self.mic
|
|
|
44 |
frame_rate = self.mic.frame_rate
|
45 |
else:
|
46 |
return "please provide audio"
|
|
|
9 |
class A2T:
|
10 |
def __init__(self, mic):
|
11 |
self.mic = mic
|
|
|
12 |
|
13 |
def __preprocces(self, audio, frame_rate):
|
14 |
try:
|
15 |
+
print("Audio before : ", audio)
|
16 |
audio = audio / 32678.0
|
17 |
print("Audio div : ", audio)
|
18 |
|
|
|
40 |
|
41 |
def predict(self):
|
42 |
if self.mic is not None:
|
43 |
+
audio = self.mic.get_array_of_samples()
|
44 |
+
audio = np.array(audio)
|
45 |
frame_rate = self.mic.frame_rate
|
46 |
else:
|
47 |
return "please provide audio"
|