Inspiration
Modern music consumption is often passive and repetitive. Playlists loop, algorithms recommend the same hits, and the curated experience lacks spontaneity. We missed the magic of traditional radio—the feeling of tuning in and discovering something unexpected in the moment. We wanted to combine that nostalgic "dial-twisting" experience with the limitless creativity of artificial intelligence. The result is Lyria: a radio for the AI age, where the music is never pre-recorded, never repeats, and is always generated fresh for you.
What it does
Lyria is an infinite AI-powered radio app. You simply tune to a channel (like "Lo-Fi," "Jazz," or "Ambient"), and the app acts as a continuous, generative radio station. Using Google's GenAI, it doesn't just play existing songs—it creates unique, high-fidelity music in real-time. To complete the authentic radio feel, Lyria features an AI Radio Announcer (or "DJ") that pipes up every 15 seconds with a punchy, charismatic station ID, telling you exactly what frequency and genre you're listening to. It's a seamless, relaxing, and endlessly fresh soundscape designed for focus, relaxation, or background ambiance.
How we built it
Lyria is powered by two core Google GenAI models working in harmony:
- Music Generation (Lyria): The backbone of the app. We used Google's Lyria model to generate the continuous, high-quality music streams that play when you tune into a station. The model is prompted with the selected genre to create an infinite, non-repetitive audio feed.
- AI Radio Announcer: To create the authentic radio experience, we built a dynamic announcer system. When a user changes the station, a two-step process is triggered:
- First, a prompt is sent to
gemini-2.5-flashto generate a short, punchy DJ script based on the new station name and frequency. - Second, this script is fed into
gemini-2.5-flash-preview-tts(with the 'Fenrir' voice) to generate a realistic, spoken audio clip. - This clip is then decoded from base64 into a playable audio buffer and mixed into the main output, ducking the music slightly so the announcer is clear.
- First, a prompt is sent to
The front-end is built with web technologies, managing the audio context, station state, and the complex timing logic to ensure the announcer speaks every 15 seconds without interrupting the flow of the generated music.
Challenges we ran into
- Synchronization & Timing: The biggest challenge was orchestrating the announcer. We had to build a robust system that handles rapid station changes (debouncing), tracks unique "sessions" (
stationId) to prevent old announcements from playing on a new station, and precisely times the 15-second intervals only when music is playing. - Seamless Audio Integration: Mixing the generated TTS audio with the continuous music stream required careful gain staging to ensure the announcer was audible but not jarring. Connecting the audio to both the speakers and a visualizer node for the "moving needles" effect added another layer of complexity.
- Real-time Generation: Ensuring the music generation from the Lyria model felt instantaneous and endless was a significant technical hurdle, requiring efficient buffering and streaming logic.
Accomplishments that we're proud of
- The Authentic Radio Feel: Successfully capturing the nostalgic "tune-in" experience with a generative AI twist. The random, charismatic DJ announcements make the app feel alive and personalized.
- Seamless User Experience: Building a system where complex, asynchronous AI tasks (script writing, audio generation, decoding) happen in the background, resulting in a smooth and uninterrupted listening experience for the user.
- Elegant State Management: The implementation of the
stationIdpattern to cancel stale promises and ensure the UI always reflects the current station is a piece of engineering we're particularly proud of.
What we learned
- Advanced Audio Manipulation: We gained deep experience with the Web Audio API, including creating and managing buffers, gain nodes, and handling raw PCM audio data encoded in base64.
- Multi-Modal AI Orchestration: We learned how to effectively chain different AI models (text generation and text-to-speech) to create a unified, complex feature like a dynamic radio announcer.
- Asynchronous Pattern Design: We honed our skills in managing complex asynchronous flows in JavaScript, using promises, timeouts, and unique identifiers to prevent race conditions and UI glitches.
What's next for Lyria
- More Station Variety: Expanding beyond basic genres to include mood-based stations (e.g., "Rainy Day," "Productivity Boost") and activity-based stations (e.g., "Workout," "Study Session").
- User Interaction: Allowing users to "like" or "dislike" a generated track to subtly influence the future direction of the music generation on their current station.
- Persistent Streams: Saving a user's session so they can return to a station they were enjoying and pick up where they left off.
- Visualizer Enhancements: Creating more sophisticated visualizations that react not just to volume, but to the musical characteristics (tempo, genre) generated by the AI.

Log in or sign up for Devpost to join the conversation.