Wanted to create my own version of siri or alexa.

What it does

Answers most if not all of your questions. Examples include but are not limited to: how many miles are in a kilometer? What is the chemical formula of salt? How far is mars from earth? Who is the current prime minister of canada?

How I built it

The frontend was based on electron, which is a javascript framework for creating desktop applications using web technologies. For the backend, I used nodejs which handled things like saving audio files to the native file system. The logic of the program is something like this: user asks a question using their microphone -> audio gets saved to system -> wit ai speech to text converts the audio question to text -> text based question gets processed through wolfram alpha api -> the response is saved as an audio file with google text to speech -> the audio file is played and the user gets their answer.

Challenges I ran into

Programming the APIs was somewhat straightforward. What I did have trouble with though, is the communication from the website and the renderer (electron). I had to send the address of the audio files (after they were saved) from the backend to the frontend and I ended up using electron apis ipcRenderer for that. IPCRenderer is an EventEmitter which 'communicates asynchronously from a renderer process to the main process'.

Accomplishments that I'm proud of

I wanted to learn electron for a while and this was the perfect opportunity for me to learn it. I am proud that I was able to create my first electron app.

What I learned

For the most part, I got to learn electron. However, that wasn't all; I learned to create requests to apis, use google tts to convert the text based answer to audio, use the 'fs' javascript module to read files on the file system, and more.

What's next for Askoro

Well, when you start the app it says 'I am your personal voice assistant' but all it can do now is answer basic questions, it's not actually personalized. In the future, I can add a user-base for the app and it would be able to create events on their calendars, run a timer, make calls, send text messages, control their smart devices etc.

Share this project: