SiriControl: A Voice Control System

SiriControl is an open source framework designed with developers in mind. It provides a simple way of using Siri commands, stated in my previous post, by dynamically loading modules created by the user. This means that you can add voice controlled capability to any project, with Siri.

The idea of using Siri to control my Raspberry Pi sounded very cool to me so I searched on the internet to find SiriProxy, which redirects the Siri commands through the Raspberry Pi, which is then intercepted. However, this was too much of a hassle and with the update of iOS 7, it stopped working. So SiriControl was born…

iot

So why use SiriControl?

  • No extra hardware required as the commands are being sent through the iOS device
  • Runs on any computer with python installed – the Raspberry Pi is especially good as you can make it control anything around you. The possibilities are endless with your imagination being the limit.
  • It is beginner friendly with minimal setup required – I have provided step by step instructions on how to set it up. It is written in python which is quite an easy language to pick up.
  • You will get the power of Siri’s fantastic speech recognition capabilities, and will be able to use it from anywhere in the world, as long as your device has an internet connection.

Overall, you will be able to add accurate voice controlled capabilities to any project for free.

Convinced that SiriControl is awesome?

Well, lets get started!

Contents

Concept

With Siri, you can create Notes by using the command word ‘Note’, which can be synced to a Gmail account. SiriControl works by fetching Notes from this account. It dynamically loads modules, created by the user, meaning that you can set it up to control anything you want, when the specific command words are heard.

This ingenious hack helps you to easily add Siri controlled capability to any project.

Setup

Gmail Account

1) A Gmail account is required for SiriControl. For security reasons, I suggest creating a new Gmail account as you will have to enter your username and password in a python script. This won’t matter as you won’t be using this for personal everyday use – just for speaking commands.

2) Then, access for less secure apps needs to be turned on, which can be done here. This is because Google identifies the connection between the python script and mail servers as less secure.

IMG_1761

3)  As the script uses the IMAP protocol to fetch new Notes, IMAP  needs to be enabled, under the Gmail settings.

IMG_1783

iOS Device

1) Now, navigate to the following, in your Settings and add your newly created Gmail account:

Settings  –>  Notes –> Accounts –> Add Account

2) Turn on Notes for that account.

IMG_1791

3) Ensure that the default account for creating Notes with Siri is your new Gmail account.

That’s it! Now, just tell Siri to create a Note like this:

“Note this is awesome”

The new note should appear under the Notes label in your Gmail account. If not, please follow the above steps again.

SiriControl Setup

IMG_1766

1) Firstly, download the scripts from here.

2) Then, open up siricontrol.py and add your username and password of your new Gmail account. This should be self-explanatory.

3) Now, run the script and say to Siri:

“Note the meaning of life”

The answer should be printed out,  because of the ‘life’ module in the modules folder. The setup is now complete.

Creating your own modules

Here is the default module that comes with SiriControl:

#You can import any modules required here

moduleName = "life"
commandWords = ["meaning","life"]

def execute(command):
    print("The meaning of life is 42")

moduleName – This is the name of the module which can be anything you want.

commandWords –  This array will have the words which need to be said in order to call the execute() function.

execute(command) – This function is called when all the words in the commandWords array are said. The ‘command’ parameter is the command said by the user, to Siri.

That’s all there is, to add Siri control to any project you want, whether it is as simple as turning on a LED to controlling your TV with infrared – the possibilities are endless, with the power of Siri behind it!

Hope you enjoy SiriControl! Please share your ideas and opinions below.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s