Add Trigger Start Sound to Google AIY Voice Kit




About: Educator, designer, tinkerer.

This tutorial is pretty simple. I have been really enjoying the Google AIY Voice Kit, but really like on my normal Google Home's the noise they make to confirm that they are actively listening. This is not setup by default in any of the examples that are pre-loaded on the AIY Voice Kit image.

I'm also including a link to the stock Start and Confirm noises that I recorded from my actual Google Home's with my Zoom recorder.

Here we go—my first instructable!

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Required Materials & Files

  1. Fully functional Google AIY Voice Kit—to set up your kit visit the official AIY Voice Kit page.
  2. Ability to access your Pi's terminal via SSH, VNC, or with a monitor and keyboard
  3. .Wav file that you want to play when Pi is listening for voice input—If not using custom file, download standard "St art Talking" file here or download it from the attached link.
  4. (Optional) Audio editor that can convert files and change their bit and sample rate

Step 2: Step 2: Check Out the File for More Information


I'm not using the latest image on my voice kit that includes the code for both the Voice and Vision kit (i.e. aiyprojects-2018-01-03.img). I'm using the code from the Voice Kit branch that can be found on the Google AIY Raspbian GitHub. My personal opinion is to just use the Voice Kit branch to keep it simple and not need to deal with the Vision code when you are working with your voice kit.

Moving on...

This step is not totally mandatory, but it will show you where Google has buried the instructions for getting this working if you want to take this a step further or understand why the code I'm adding working.

pi@raspberry: cd AIY-voice-kit-python/src/aiy/

Then we are going to check out the file in that folder:

pi@raspberry: ~/AIY-voice-kit-python/src/aiy/sudo nano

The attached picture shows where you can learn about Status UIs and how to use a sound during the trigger.

Alright, now let's add some code to one of the example files to get this thing working.

Step 3: Step 3: Add Trigger Sound Code to Demo Code

First, navigate to the AIY-voice-kit-python folder and run the source code

cd AIY-voice-kit-python
source env/bin/activate
cd src

Then use 'sudo nano' into either '' or ''

The different between the two files is that uses the button to trigger Google Assistant and uses the activation word "Ok, Google" to trigger the Google Assistant.

For both of these files you only need to add ONE line of code:


This assumes you have placed your start sound in the /home/pi/ folder and named it googlestart.wav. Change these based on whatever you named your file and wherever you located it.

The line of code we are looking for is below:


We want to add our new line of code BEFORE that line of code...

For the '' example it can be found here:

elif event.type == EventType.ON_CONVERSATION_TURN_STARTED:
# And now add our code

For the '' example it can be found here:

# And now add our code

This assumes you have placed your start sound in the /home/pi/ folder and named it googlestart.wav. Change these based on whatever you named your file and wherever you located it.

Hit CTRL-X & Y to save everything.

***NOTE: I have found something a little goofy. For the '' adding the trigger sound seems to not make any difference in the function of the speech recognition. For the '' though, it seems when you have the trigger sound implemented it cuts off the first word or two that you say. Not totally sure why. Still trying to figure it out.

Step 4: Step 4: Run the Code and Make Sure Everything Is Good to Go

pi@raspberry: cd AIY-voice-kit-python

and load up virtualenv

pi@raspberry:~/AIY-voice-kit-python $ source env/bin/activate

and run it!

(env) pi@raspberry:~/AIY-voice-kit-python $ src/


(env) pi@raspberry:~/AIY-voice-kit-python $ src/

Now say "Okay, Google" or Press that Button and see if it works!

The next page will help you out if you have your own custom file and the appropriate bit and sample rates for your .wav file

Step 5: Step 5: Create Your Own .wav File

If you aren't interested in using my .wav file of the standard Google Home start sound, you'll need to create your own .wav file. It took a bit of trial and error to get the correct bit and sample rate to work for me.

I used Logic Pro X to do all my editing (pictured), which is a fully-fledged DAW for creating and producing music. Two options I have found that could be suitable are Switch or MediaHuman Audio Converter. I assume you could do this with Garageband if you have a Mac, but I haven't tried that out.

There are three key parts of your file that are needed for it to work with the demo code.

  1. Must be a MONO audio file
  2. Sample rate must be 32000
  3. Must be a .wav file
  4. (Optional) 16 bit resolution has worked best for me

Step 6: Step 6: Adding the Confirmation Sound?

This is where I am stuck if anyone has any thoughts. I would love to add the confirmation noise if the system recognizes the voice input like on a normal Google Home.

I have attached the stock Confirmation noise below for your convenience.


Be the First to Share


    • CNC Contest

      CNC Contest
    • Make it Move

      Make it Move
    • Teacher Contest

      Teacher Contest

    6 Discussions


    9 months ago

    what if you have the latest version without virtualenv , is there another way of doing this

    1 reply

    Reply 7 months ago

    Yes. Change the following two files (depending on which one you use):
    In, add "import os" to the top and down below, make it look like this (I only added one line)
    while True:'Press button to start conversation...')
    os.system('aplay /home/pi/googlestart.wav') #<-------- Add this line'Conversation started!')
    In, again add "import os" to the top and make it look like this (I only added one line):

    elif event.type == EventType.ON_CONVERSATION_TURN_STARTED:
    led.state = Led.ON # Listening.
    os.system('aplay /home/pi/googlestart.wav') #<-------- Add this line


    1 year ago

    To add the end sound, you have to add the trigger to the script located in the /AIY-projects-python/src/aiy/_drivers folder. At the very bottom of the script, you'll see where it triggers the wav file if the status is set to 'listening'. Just add the following below it:

    elif status == 'thinking' and self._trigger_sound_wave:

    Then on your script, add the following line just above the "status_ui.status('thinking') line:


    1 reply

    Reply 1 year ago

    Fantastic! Thanks for the help on this. I’m going to give it a try and if all works well I’ll add it to instructions—crediting you of course!