Kitt-AI / snowboy

Future versions with model training module will be maintained through a forked version here: https://github.com/seasalt-ai/snowboy
Other
3.11k stars 1.01k forks source link

Logging #25

Closed sammachin closed 8 years ago

sammachin commented 8 years ago

Getting snowboy integrated into the AlexaPi project :)

However there seems to be quite verbose logging printing to stdout I get INFO:snowboy:Silence every 100ms or so.

How do I turn off/adjust the output?

chenguoguo commented 8 years ago

Great!

That Silence info is not necessary and can be deleted. Could you point me to your integration? I can point out for you which line you can delete.

sammachin commented 8 years ago

I can't publish the AlexaPi Snowboy code yet as I'm waiting on Amazon legal, but this is the same test project I used as a starting point https://github.com/sammachin/wakeword_wouter

chenguoguo commented 8 years ago

Looks like the project you pointed me to is a little bit out of date. But anyway what you have to change in your new project is the file snowboydecoder.py, see the code

   if ans == -1:
       logger.warning("Error initializing streams or reading audio data")
   elif ans > 0:
       message = "Keyword " + str(ans) + " detected at time: "
       message += time.strftime("%Y-%m-%d %H:%M:%S",
                                time.localtime(time.time()))
       logger.info(message)
       callback = detected_callback[ans-1]
       if callback is not None:
           callback()

In you new project, you most likely have something like

   if ans == -1:
       logger.warning("Error initializing streams or reading audio data")
   elif ans == -2:
       logger.debug("Silence")
   elif ans > 0:
       message = "Keyword " + str(ans) + " detected at time: "
       message += time.strftime("%Y-%m-%d %H:%M:%S",
                                time.localtime(time.time()))
       logger.info(message)
       callback = detected_callback[ans-1]
       if callback is not None:
           callback()

You can simply delete the logger.debug("Silence") part.

chenguoguo commented 8 years ago

I guess the issue has been resolved? Closing this.