CineAI commited on
Commit
6d73c34
·
verified ·
1 Parent(s): d2bbc44

Update audio2text/a2t.py

Browse files
Files changed (1) hide show
  1. audio2text/a2t.py +5 -1
audio2text/a2t.py CHANGED
@@ -22,9 +22,13 @@ class A2T:
22
  chunk = self.mic
23
  audio = np.array(chunk)
24
  print(audio)
25
- return self.__transcribe(inputs=audio, task=TASK)
26
  else:
27
  return "please provide audio"
 
 
 
 
 
28
 
29
  except Exception as e:
30
  print("Predict error", e)
 
22
  chunk = self.mic
23
  audio = np.array(chunk)
24
  print(audio)
 
25
  else:
26
  return "please provide audio"
27
+
28
+ if isinstance(audio , np.ndarray):
29
+ return self.__transcribe(inputs=audio, task=TASK)
30
+ else:
31
+ return "Audio is not np array"
32
 
33
  except Exception as e:
34
  print("Predict error", e)