Inspiration

The idea for MoodGAIJ came to us one evening while we were all gathered in a friend’s room, brainstorming ideas for a hackathon. We had a few concepts, but none of them really stuck. So, we decided to take a break, relax, and play some music while chatting. As our conversation shifted topics and moods, we found ourselves constantly changing the music to match the vibe. That’s when the idea struck us: why not create a device that could automatically adapt the music to match the conversation's mood, without us needing to lift a finger?

And that’s how MoodGAIJ was born. With MoodGAIJ, we no longer have to disrupt the flow of our conversations to adjust the background music—it seamlessly adapts for us. We even threw in some fun, colorful lights to enhance the atmosphere.

What it does

MoodGAIJ combines PyVoice, the Spotify API, and the Groq API to intelligently listen to nearby conversations and adapt instantly to their mood. It not only selects a song that aligns with the conversation’s tone but also emits mood-matching ambient lighting. So, if a conversation shifts from happy to sad, there’s no need for an awkward song change—MoodGAIJ ensures a seamless, dynamic listening experience.

How we built it

We created a shared GitHub repository to collaborate on the project and divided the tasks into three main components: speech-to-text, text-to-Groq, and Groq-to-Spotify.

The speech-to-text process uses the PyVoice API to convert conversations picked up by MoodGAIJ’s microphone within the first 30 seconds into text. This text is then fed into the Groq API, which analyzes the conversation and returns the most fitting mood, along with a corresponding color and its hex code. Next, the mood is passed to the Spotify API, which generates a curated playlist based on the detected mood and plays the first song from the list. Finally, the color, in hex code form, is sent to the LED screen inside MoodGAIJ, setting the appropriate ambiance. During the last 30 seconds of a song, the microphone begins picking up on the conversation again, and the loop repeats.

The hardware includes a Raspberry Pi, LEDs, and a speaker to complete the setup.

Challenges we ran into

When we first began the project, we hoped to use ChatGPT; however, due to unforeseen issues with rate limits, we were unable to proceed with it. We then pivoted to the Groq API, which caused far fewer issues. Additionally, we initially encountered difficulties using Whisper for the speech-to-text portion but switched to PyVoice, which proved much smoother. Syncing the hardware with our software was also challenging. The Raspberry Pi’s low computational power required us to optimize the code to ensure everything ran within a reasonable time. Since the presentations were here at UMass, our Wi-Fi options were limited to those provided by the campus. As these required passing through a login screen, we had to be creative in finding a solution. Ultimately, we installed the Legacy version of Raspberry Pi OS, an older version that worked well for our needs.

Accomplishments that we're proud of

Integrating all the APIs and getting them to function coherently with each other is an accomplishment we're proud of. The ability to break the entire project into separate components and then tie them all together through our collective effort was particularly impressive to us. It demonstrated how well we could synergize as a team. With teamwork, there's always uncertainty about whether efficiency will be maintained, but we're pleased with our communication skills, which made the process of threading everything together run smoothly.

What we learned

We learned how to incorporate various APIs, initially unrelated to each other, and combine them to coherently solve a problem. We also gained experience in 3D printing and learned how to communicate effectively with multiple partners under time constraints.

What's next for MoodGAIJ

We hope to improve the hardware by designing a better enclosure. We also plan to add animations for the lights that sync with the beat of the songs. Additionally, we would like to revisit using ChatGPT as our chatbot of choice.

Built With

Share this project:

Updates