Snowboy API for AIY Voice Kit
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2fb469b Jun 14, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
mod replace to original snowboy resources May 29, 2018
.gitignore add May 28, 2018
LICENSE Initial commit May 28, 2018 fix readme Jun 3, 2018 Comment out the original program May 29, 2018 add debug logger Jun 14, 2018


Snowboy API for AIY Voice Kit.
Replace your AIY Voice Kit hotword [OK. Google] to [alexa],[jarvis]...etc
You can easily replace your program.
See. diff AIY Voice Kit Press button and own hotword program

Before How to install

Buy The AIY Voice Kit and complete the tutorial.
custom-hotword-for-aiy-voicekit use lowlevel api AIY Voice Kit.

Are you work your voice kit this program?


If the demo has worked,next step.

How to install

cd /home/pi/
# libatlas-base-dev need snowboy module.
sudo apt-get install libatlas-base-dev
git clone

# copy snowboy module and sample program.
cp -ipr custom-hotword-for-aiy-voicekit/mod AIY-projects-python/src/
cp -ip custom-hotword-for-aiy-voicekit/ AIY-projects-python/src/examples/voice/

How to use

cd AIY-voice-kit-python
chmod a+x src/examples/voice/
src/examples/voice/ src/mod/resources/alexa/alexa_02092017.umdl

Say "alexa" and talk your google assistant!

sample log

pi@raspberrypi:~/AIY-voice-kit-python $ src/examples/voice/ src/mod/resources/alexa/alexa_02092017.umdl
/opt/aiy/projects-python/src/aiy/_drivers/ RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(channel, GPIO.OUT)
[2018-06-03 14:33:26,194] INFO:recorder:started recording
Speak own hotword and speak
[2018-06-03 14:33:28,634] INFO:snowboy:Keyword 1 detected at time: 2018-06-03 14:33:28
[2018-06-03 14:33:31,478] INFO:speech:transcript: What
[2018-06-03 14:33:31,483] INFO:speech:transcript: What is
[2018-06-03 14:33:31,485] INFO:speech:transcript: What is your
[2018-06-03 14:33:31,487] INFO:speech:transcript: What is 4
[2018-06-03 14:33:31,489] INFO:speech:transcript: What is よね
[2018-06-03 14:33:31,491] INFO:speech:transcript: What is your name
[2018-06-03 14:33:31,492] INFO:speech:transcript: What  is your name
[2018-06-03 14:33:31,494] INFO:speech:transcript: What is  your name
[2018-06-03 14:33:31,496] INFO:speech:event_type: 1
[2018-06-03 14:33:31,501] INFO:speech:transcript: What is your name
You said " What is your name "
Speak own hotword and speak

Make your own hotword

Make your own hotword this site.
and download your voice kit [hotword].pmdl
(how to make your hotword by snowboy, google it ^^!)

and run program argument your hotword

cd AIY-voice-kit-python
src/examples/voice/ [hotword].pmdl

diff original program(AIY Voice Kit Press button), snowboy wakeword program

$ diff -u src/examples/voice/ src/examples/voice/
--- src/examples/voice/	2018-04-14 06:05:49.000000000 +0900
+++ src/examples/voice/	2018-06-03 14:31:40.356212421 +0900
@@ -21,6 +21,16 @@
 import aiy.voicehat

+import mod.snowboydecoder as snowboydecoder
+import sys
+if len(sys.argv) == 1:
+    print("Error: need to specify model name")
+    print("Usage: python your.model")
+    sys.exit(-1)
+model = sys.argv[1]
     format="[%(asctime)s] %(levelname)s:%(name)s:%(message)s"
@@ -31,12 +41,15 @@
     status_ui = aiy.voicehat.get_status_ui()
     assistant = aiy.assistant.grpc.get_assistant()
-    button = aiy.voicehat.get_button()
+    #button = aiy.voicehat.get_button()
+    detector = snowboydecoder.HotwordDetector(model, sensitivity=0.5)
         while True:
-            print('Press the button and speak')
-            button.wait_for_press()
+            #print('Press the button and speak')
+            print('Speak own hotword and speak')
+            #button.wait_for_press()
+            detector.start()
             text, audio = assistant.recognize()
pi@raspberrypi:~/AIY-voice-kit-python $