Inspiration

We heard that it was space themed and immediately thought why not make a HAL chatbot.

What it does

It listens to the user and allows for a spoken conversation with HAL. When run, it will open HAL and start talking.

Operation

Run the main.exe file. At the start of the program it will say "speech recognition activated"

  1. To start conversation say: "Open the pod bay doors HAL"

  2. HAL will respond with a quote from the movie and wait for your next request!

  3. You can say anything and HAL will respond with an ai generated response

  4. To exit: close the window or say "HAL I won't argue with you anymore"

Fun Easter Egg: Ask HAL to sing you a song, it will play an audio clip from the original movie!

How we built it

We used a variety of libraries in order to get this to work correctly. First we used google speech recognition to listen and transcribe audio inputs. Then the audio text is passed to chatgpt to start a conversation. Finally the output is passed through a google text to speech layer and output as an audio file.

Challenges we ran into

We used tkinter to create the HAL output image, however in order to have audio processing and the HAL image we had to use threading. Tkinter does not support threading though so we were having issues with exiting the program on the window close. These have since been resolved. Another issue was that initially we tried to use the playsound library in python. However this will not actually stop playing a sound and let you reuse the function so for HAL to continuously talk we had to find another option. We settled on used the sound option in pygame.

Accomplishments that we're proud of

We were able to get a fully fledged program that will actually do the desired affect! We also added some special keywords to start the conversation, end the conversation, and also play a the song "Daisy" sung by HAL from the original movie.

What we learned

We learned a lot of different things, from multithreading, to race conditions, to git etiquette within in a team, signal processing, and how to interface with multiple functions running at once.

What's next for HAL 9000 Desktop Buddy

The next thing for the HAL 9000 Desktop Buddy is to add more scifi and other character profiles, add some more movie quotes from various films depicting said characters, and make it so the chatgpt API key will not be revoked.

Built With

  • chatgpt-api
  • google-speech-recognition
  • google-text-to-speech
  • pygame
  • python
Share this project:

Updates