Guys I did it. I actually DID IT. After two weeks of learning Python continually I got a fully working Jarvis clone/Siri clone that uses 2 of the major AI knowledge databases as well as 1 conversation AI. Once I start the program it listens for me to talk and once I do it waits until I am finished talking, waits 3 seconds to see if I need to add something and then converts the .mp3 to a .flac. Once it does that it then sends it to http://www.google.com/speech-api/v1/recognize?lang=en_EN
with the contents of the .flac as POST. Then once it receives the string back it, depending on whether or not it's on conversation mode, sends it either to Evi(Question mode) or Cleverbot(Conversation mode). If Evi doesn't know (returns an error) then it sends it to Wolfram|Alpha. If that one doesn't even know then it sends it to Cleverbot to get a really sarcastic answer. Then it sends the answer string to http://translate.google.com/translate_tts
, which returns an mp3. Then, obviously, it plays that! Once I get an Arduino I'm going to hook JAIK (Jake is what I call it) to my TV, room light, and radio for the ultimate Jarvis clone! This was just a thing to get used to Python and I used multiple modules and the code is extraordinarily messy so don't kill me. Also, it's currently set up for Linux with cvlc for playing media.
Here's a list of the modules if your really, really want to run it:
- wave (might be built in, I forget)
- cleverbot (included in the file so you don't need to download it)
- You no longer need to download the modules, they are all packaged in the main project.
- Fixed a bug which caused Wolfram|Alpha not to work.
- Big bandwidth killer removed.
- Python 3 Compatible!
Here's the download:Download here!
To start the program run 'python CAIF.py'
- Say a sentence with 'exit' or 'quit' will quit the program.
- Run a program by saying 'run "program_name"'. Keep in mind that the Speech to Text won't translate periods and lots of other things so this is pretty much useless for arguments and stuff, but whatever.
And here's some pictures: