CineAI commited on
Commit
b5e3b33
1 Parent(s): 3aafbca

Update audio2text/a2t.py

Browse files
Files changed (1) hide show
  1. audio2text/a2t.py +2 -2
audio2text/a2t.py CHANGED
@@ -20,8 +20,8 @@ class A2T:
20
  def predict(self):
21
  try:
22
  if self.mic is not None:
23
- chunk = self.mic
24
- audio = np.frombuffer(chunk, dtype=np.uint8)
25
  print("audio : ", audio)
26
  else:
27
  return "please provide audio"
 
20
  def predict(self):
21
  try:
22
  if self.mic is not None:
23
+ chunk = self.mic.get_array_of_samples()
24
+ audio = np.array(chunk)
25
  print("audio : ", audio)
26
  else:
27
  return "please provide audio"