Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
with SampleAssistant(lang, device_model_id, device_id,
conversation_stream, display,
grpc_channel, grpc_deadline,
device_handler) as assistant:
wait_for_user_trigger = not once
import snowboydecoder
model = 'resources/models/anpanman.pmdl' # アンパンマンのホットワードモデル
detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5)
print('Listening... Press Ctrl+C to exit')
def detected():
detector.terminate()
time.sleep(.05)
continue_conversation = assistant.assist()
wait_for_user_trigger = not continue_conversation
detector.start(detected_callback=detected,
interrupt_check=interrupt_callback,
sleep_time=0.03)
def interrupt_callback():
return not wait_for_user_trigger
detector.start(detected_callback=detected,
interrupt_check=interrupt_callback,
sleep_time=0.03)
detector.terminate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.