Coding my own AI assistant(SIRI) using python
- Apr 15, 2022
- 3 min read
Updated: Sep 26, 2024
by Lisa Hadi

Initial Thoughts
Right now, I am trying to code my own SIRI. I decided to make my own voice activated digital assistant because I think it would be cool to have my own Apple SIRI or Google Alexa. So, I have coded one before a couple years ago, but I don't really remember how to code it anymore. Unfortunately, I lost most of my python knowledge. Now you guys can follow me along my journey to brushing up on python and making a digital assistant.
Journey
[Day 1]
Hey guys! So today I installed python. Some initial problems I encountered were setting up python and installing packages. I am not exactly sure about how to install packages, so I will have to do some research. I successfully downloaded python and was able to print hello world. Ha! That's a step forward..#babysteps .
[Day 2]
Hello. I am having a lot..A LOT.. of trouble with installing pyaudio. pyaudio just won't install..it's very frustrating. If you guys have any advice please email me. #python #pyaudiotroubles . I think it has to do with PyAudio itself..I'm not too sure. I tried using pipwin install pyaudio and pip install pyaudio, but neither worked. I also tried installing a wheel, but that did not work. I also installed anaconda and made a conda environment to do conda install pyaudio, but that did not work either. So..right now I am stuck. I was, however, able to make my program speak. That's nice.

This is what I have so far! I figured out how to use pyttsx3..not entirely though. I figured out how to make it talk. I tried to see what datetime does. I know it tells you the date. I can make it print, but I am still working on making Dave tell me the date and time. Sigh..Dave just talks..he can't listen TT. I also tried to import speech recognition, but i need pyaudio to make it work.
Hello, I am back. I worked on my code for another 2 minutes and I am now back to document my progress. Also so you guys can see what I am doing.

So this is what I have now. I imported datetime in the first few lines of my code. So now I made a time variable and set it equal to the datetime.datetime.now(). That basically tells me the time and date now. I did engine.say so that Dave can say it outloud. I figured out that you can't print/say text and numbers in the same line. I made the time into a string by putting str with the time variable. So Dave will say "the time now is [time]". The %H:%M is the format of the time. Hours:minutes. It is set in military time, so I will find a way to make it standard time. I am still not sure if i have to type engine.runAndWait() every time I want to use engine.say.
--5 minutes later--
Guys! I did something!

Ok so I made it so that the code takes user input. It asks "what do you need help with?" Once it asks that if I type in what time is it now then dave will say the time now is [whatever time]. If it is anything other than that then it will pass it and end the program. That's pretty cool! This is what I'm doing untill I get pyaudio to work..I may need to get help from someone. Hm..
[Day 3]
Guys! I got pyaudio to work!! I switched computers, so I am now using my brother's computer. I was able to import webbrowser, so now it is programmed to search for whatever I ask. It can also take notes for me. I will go more in depth in how to code a digital assistant when I finish this project. It is still very buggy, so I am currently working through the bugs. Right now, a problem I am encountering is with a local variable. When I type return command it says that my variable is local. I tried using the global keyword, but it still did not work. I will look into it more. I am very excited with where I am at in this project.

Update post-development :
Those were my initial struggles with developing this project. Now, I have finished coding it. I also got a hologram projector, so I can project the hologram.
Comments