fix stuff
This commit is contained in:
13
core/speech_recognition.py
Normal file
13
core/speech_recognition.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import json
|
||||
|
||||
from audio.audio_queue import q
|
||||
|
||||
|
||||
def listen_for_command(rec):
|
||||
while True:
|
||||
data = q.get()
|
||||
if rec.AcceptWaveform(data):
|
||||
result_json = json.loads(rec.Result())
|
||||
result = result_json.get("text", "").lower().strip()
|
||||
if result:
|
||||
return result
|
||||
Reference in New Issue
Block a user