Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
Im trying to get snowboy to work with hotword detection. I cannot seem to get it working.
For some reason it wont detect hotword. Im new to python so any suggestions? thank you!

What I have tried:

import logging
import os
import random
import signal
import sys

# Melissa
 from melissa import profile
 from melissa.tts import tts
 from start import main
 from utilities import snowboydecoder, snowboydetect

interrupted = False


def signal_handler(signal, frame):
global interrupted
interrupted = True


def interrupt_callback():
global interrupted
return interrupted


 WORDS = {'go_to_sleep': {'groups': ['sleep', 'bye', 'deactivate', 'stop',
     'suspend', 'quit', ['power', 'off'], ['stand', 'down'],
     ['good', 'bye']]}}



 def go_to_sleep(text):
      replies = ['See you later!', 'Okay. voice activation on, say my name to wake me up']
      tts(random.choice(replies))

model = 'Wake.pmdl'
# capture SIGINT signal, e.g., Ctrl+C
signal.signal(signal.SIGINT, signal_handler)

 detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5)




print('Listening... Press Ctrl+C to exit')

# main loop
  detector.start(detected_callback=melissa,
             interrupt_check=interrupt_callback,
           sleep_time=0.03)

 detector.terminate()
Posted
Updated 28-Feb-20 5:55am
v2

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

First suggestion is that you should please explain what the problem is. My second is that you go to The Python Tutorial — Python 3.7.6 documentation[^] and work through it a few times. Some actual solid study now will pay dividends in the future.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100