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.07k stars 997 forks source link

Loudness / Correctness of the triggered Hotword #495

Open markuspaschi opened 6 years ago

markuspaschi commented 6 years ago

Hi,

is there a way to check how accurate / loud the spoken hotword was? Because i have multiple Devices with Snowboy detection running and want to know, which one was triggered the best (closest) was the loudest or most accurate.

I thought about this line (in the snowboydecoder.py)

        ans = self.detector.RunDetection(data)
        elif ans > 0:
                message = "Keyword " + str(ans) + " detected at time: "
                message += time.strftime("%Y-%m-%d %H:%M:%S",
                                         time.localtime(time.time()))

And analyzing that buffer for loudness. Not excactly sure if thats the way. If you have any ideas let me know pls :)

Thanks in advance :)

markuspaschi commented 6 years ago

If anyone is interested:

I added this line:

rms = audioop.rms(data, 2)

after elif ans > 0 and get the rms of the triggered hotword. Works so far. Maybe this can be implemented (pushed) as well.

Greetings Markus