Coder Social home page Coder Social logo

aiyhotworddetector's Introduction

AIY Hot Word Detector - converted my Raspberry PI to a Google Assistant with a custom hot word

Source: https://cyber-renegade.org/2017/12/21/aiy-voice-kit-voice-vad-or-hotword-activation/ (Not sure where I got all this code from, but the above blog links it to the author. The code in this repo has my modifications)

This code is uses snowboy to create a local hotword detector for the AIY Voice Kit api version 2. Also allows voice activation. You can demo the system by using the snowboy.umdl file and "snowboy" as the hotword.

Otherwise you need to get an account with snowboy to create your own hotword file. Use recordKeyword to create this file. You will need to update the following details in recordKeyword.py including the token from your snowboy account. This will be downloaded to your resources folder.

############# MODIFY THE FOLLOWING #############
token = "put_your_snowboy_token_here"
hotword_name = "name_of_your_hotword"
language = "en"
age_group = "50_59"
gender = "M"
microphone = "voicehat"
durationSecs=2
############### END OF MODIFY ##################

When you have created your hotword you need to update the name of the file in miaHotword.py.

  ############# MODIFY THE FOLLOWING #############
  model_file='./resources/your_hotword_name.pmdl' # put your hotword file here. if you want to just try out use ./resources/snowboy.umdl
  sensitivity = 0.5
  ############### END OF MODIFY ##################

Once you have done this run either python HotwordDemo.py and ask something about holidays to use the google cloud services or python assistant_grpc_hotworddemo.py for the google assistant.

To run snowboy you may need to install libatlas, but other than that you don't need to install the other snowboy prerequisites such as pyaudio and sox as this is using the voice hat for the recording

sudo apt-get install libatlas-base-dev

Everything here is using Python 3 so run the /home/pi/bin/AIY-voice-kit-shell.sh which should set this up for you. I have made available all the snowboy files which work with Python 3 as they aren't available on the snowboy site and there doesn't seem to be a correct version of Swig to compile for the pi. But this all works on my machine as they say. If I've missed something then let me know. The easiest way is to copy all these files and the resources folder into the src folder.

For more details see my blog https://danicymru.wordpress.com/2017/12/21/aiy-voice-kit-voice-vad-or-hotword-activation/. Let me know if there are any issues and any comments are welcome.

aiyhotworddetector's People

Contributors

vatodorov avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.