This is a very early version of a Siri Server (not a proxy).
Apple's Siri is an voice controlled assistant on iPhone 4S.
With jailbreaking you can install it on other iDevices. However, Siri needs a server to communicate to do the speech processing. Apple only allows 4S devices on their servers.
This project tries to recreate the Apple Siri Server to use it with other iDevices.
You don't need any 4S keys to make it work, as it is independent from Apple.
It uses Google Speech-To-Text API. And therefore we are currently limited to commands that are shorter than 10 seconds (maybe we can overcome this).
We have a new plugin system: Check out the plugins folder and the example plugin for more infos. It supports multi-language inputs.
You should also checkput the plugin.py to see what a plugin has for predefined methods. You can also look at the time plugin, it sends more complexe objects and does meaningful localized output. And does more complex processing of different inputs
The file SiriProtocol documents everything I (and others) found out about the protocol by now
Install audio libraries
For the audio handling you need libspeex and libflac
On Linux simply install it via you packet manager e.g. (or see instructions and note for OS X):
sudo apt-get install libspeex1 libflac8
On OS X download libspeex and libflac from the websites above (the sources, not the binaries) and compile and install them, or simply follow the following steps: You need to open Terminal into the folder that you uzipped from the websites.
./configure --disable-asm-optimizations
make
sudo make install
Note: On both of them the --disable-asm-optimizations it very important on Lion, but you might as well do it anyway.
Python requirements
As this project is coded with python you need a python interpreter (this is usually already installed). I work with python 2.6.6 and 2.7.2 and both work.
You also need some python packages to make it work:
biplist
M2Crypto
You can install both via easy_install
,
If you install the latest Python from their website [http://www.python.org] you will get easy install.
easy_install is available at http://pypi.python.org/pypi/setuptools,
on Linux you can also get it via your packet manager:
sudo apt-get install python-setuptools
After you installed it, run:
easy_install biplist
easy_install M2Crypto
Certificate Generation
We also need to generate certificates forguzzoni.apple.com
or any other domain
cd gen_certs
then
sudo ./gen_certs.sh
or
sudo ./gen_certs.sh 192.168.1.1
or
sudo ./gen_certs.sh domain.com
this will generate a certifcaite for guzzoni.apple.com
, 192.168.1.1
or domain.com
Notice, you need to put your IP of the machine from which you are running the server.
When you use Spire, just enter as address what ever parameter you supplied to gen_certs.sh
e.g.:
https://guzzoni.apple.com
or
https://domain.com
or
https://192.168.1.1
In case you don't have Spire or want to use guzzoni.apple.com
you need to setup a DNS spoofing or manipulate you hosts file. I dont know how to do this.
Please make sure to install the CA certificate on your iDevice (you can simply mail it to yourself). It is the CA.pem file that was copied by gen_certs.sh to the servers root. In your mail, just click on the certificate and install it.
Running the server
Now you are ready to go, start the server with:
sudo python siriServer.py
Note: You need to run it as root, as we use https port 443 (non root can only use ports > 1024) for incomming connections.
If we had the mid 90s this section would glow and sparkle to get your attention. There are some errors that might occur even though you did everything that was written above...
The server just crashes after a SpeechPacket
You are running Linux right? Probably debian?
There is probably already a libspeex on your machine which is optimized for SSE2 which does not work with python (reason???)
Check if there is a /usr/lib/sse2/libspeex.so.1
.
Option A: delete it (there should also be a version in /usr/lib if you installed via apt, or in /usr/local/lib if you compiled by hand)
Option B: ToDo
This M2Crypto thing is not working
Did you install all dependencies of M2Crypto?
I cannot get a connection from device to server
Do you access your server over the internet? You need to setup your firewall and NAT to allow traffic for tcp port 443 directed to your server Do you have a local firewall on the machine running the server? Also check if tcp port 443 is allowed for incomming connections
There is an exception with something around a database lock
error: uncaptured python exception, closing channel <main.HandleConnection connected xxx.xxx.xxx.xxx:XXXX at 0xa65c368> (:database is locked
Solution: delete the .sqlite3 file and restart server
A big thanks to Applidium and also plamoni for his SiriProxy which inspired me Thanks to everyone that contributed code or ideas. I, keaton876, did not write most of this code, just forked it and tried to make a better guide.
This is free software. You can reuse it under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 license. So you can do what ever you want with it. But you are not allowed to sell it. If you like to do more than the license allows, please contact me and ask for a special commercial license.
Apple owns all the rights on Siri. I do not give any warranties or guaranteed support for this software. Use it as it is.