Spaces:
Sleeping
Sleeping
truongghieu
commited on
Commit
·
a266d09
1
Parent(s):
4a60c8d
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ import numpy as np
|
|
5 |
|
6 |
def recognize_speech(audio_data):
|
7 |
# nontype to wav
|
8 |
-
audio_data = sr.AudioData(np.array(audio_data) , sample_rate=16000, sample_width=2)
|
|
|
9 |
recognizer = sr.Recognizer()
|
10 |
try:
|
11 |
text = recognizer.recognize_google(audio_data)
|
|
|
5 |
|
6 |
def recognize_speech(audio_data):
|
7 |
# nontype to wav
|
8 |
+
audio_data = sr.AudioData(np.array(audio_data) , sample_rate=16000, sample_width=2).get_wav_data()
|
9 |
+
|
10 |
recognizer = sr.Recognizer()
|
11 |
try:
|
12 |
text = recognizer.recognize_google(audio_data)
|