Inspiration

We were inspired to create a collaborative music experience where each user can listen to music together while curating a unique playlist that is an amalgamation of all music tastes. The system aggregates user preferences and listening histories to construct a shared queue that dynamically shifts as users interact with it. Unlike conventional playlist generators that rely solely on individual user profiles and tastes, we wanted to create a system that emphasizes collective curation, capturing multiple users' unique music preferences into a coherent and balanced listening experience.

Introducing: Unifi

Unifi allows users to share and experience music together in a single, collaborative space. When a user joins a room, the system automatically curates a playlist that blends their favorite songs with those of others already in the session.

Users can guide the playlist by sending messages or voice notes with requests, moods, or preferences to the AI DJ, and the music will adapt the music accordingly. This ensures everyone hears songs they enjoy while also discovering new tracks introduced by friends, creating a dynamic and social listening experience for all.

How we built it

Unifi is built on Next.js as the core framework, providing a performant and scalable web architecture for both the client and server. We integrated the Spotify Web API to enable real-time music playback, track retrieval, and playlist management, allowing seamless synchronization between multiple users’ listening sessions. For text-to-speech, Unifi uses ElevenLabs, enabling natural, expressive spoken output for the in-app DJ persona and audio-based interactions. It is hosted on Vercel. The application’s intelligent features are powered by Google Gemini, which performs several key functions:

  1. Personalized Recommendations: Gemini analyzes combined user listening data to suggest tracks that reflect the shared musical identity of the group.
  2. Speech-to-Text Interaction: Users can verbally request songs or genres, and Gemini processes those commands through its transcription and language understanding capabilities.
  3. Dynamic Visual Adaptation: The model interprets the emotional tone and tempo of the current track, automatically generating background color palettes that visually harmonize with the music.

Together, these technologies create an interactive, socially driven music environment to converge many listeners’ preferences.

Challenges we ran into

One of the primary challenges in developing Unifi was achieving real-time synchronization of audio playback, room activity, and playlist updates while hosting on Vercel, which we learned does not support WebSocket connections. Since WebSockets are ideal for continuous bi-directional communication, it required a lot of rethinking of how to propagate updates efficiently between users in shared listening sessions.

To mitigate these constraints, we structured our system around polling API endpoints that return the most recent room state snapshot to ensure every user in the room shares a consistent song and queue. While this solution functions under this architectural limitation, in the future, we hope to migrate to a hybrid architecture that would enable the use of sockets for constant connection between all users.

Spotify's API is also incredibly finicky: rate-limiting us for 24 hours at one point, requiring a complete makeover in environment variables and project details.

Accomplishments that we're proud of

We are all proud of our ability to adjust and adapt our ideas to resolve the issues we encountered. We learned to navigate the constraints without websockets, figuring out ways to keep everyone in sync. Even with the technical hurdles, seeing the AI curate playlists that blend everyone’s tastes and respond to requests was pretty satisfying.

What we learned

We learned that generative AI can be used in a way that allows users to guide the AI, creating a richer, more engaging experience. We also learned about integrating multiple services, such as music streaming, AI reasoning, text-to-speech, and visual adaptation. Lastly, we learned that collaborating and discussing as a team our vision for the end project created the best end result; teamwork makes the dreamwork!!

What's next for unifi

The next phase of Unifi will work on real-time updates through a WebSocket architecture. This upgrade will allow for low-latency communication between all connected users and ensuring true synchronization of playback, playlist modifications, and chat interactions.

In addition, Unifi will introduce individual music rooms, where users can create or join a shared session using a unique room code. Within each room, participants can collectively queue songs, adjust preferences, and influence AI-driven playlist generation in real time.

Future development will also extend Gemini’s functionality beyond recommendation and transcription to support a more interactive DJ persona. The goal is to enable a space where users can bounce ideas and obscure music tastes to shape the playlist and dynamically modify the listening environment.

Built With

Share this project:

Updates