Inspira## Inspiration
Alexa exists for Amazon's mobile app — you talk, music plays. But open Amazon Music in a browser and that experience completely disappears. I thought about the people that gap actually hurts: someone with a motor impairment who cannot type, an elderly user overwhelmed by complex UI, a professional with both hands occupied trying to skip a song. That frustration became the mission — give the Amazon Music web app a voice. TwinLexa is Alexa's twin brother, built to do for the web what Alexa does for mobile.
What it does
TwinLexa is a Chrome extension overlay that sits invisibly on top of Amazon Music. You click the mic button, speak naturally, and TwinLexa executes your command directly on the page — searching for songs, controlling playback, creating playlists, adding tracks, and playing music by mood — all without touching the keyboard or mouse. Nova Sonic responds back in natural spoken voice, making the entire interaction feel like a conversation rather than a command prompt.
How we built it
I built TwinLexa as a Chrome extension using React and TypeScript on the frontend. When the user speaks, the Web Audio API captures microphone input, MediaRecorder encodes it as WebM/Opus chunks, and a WebSocket streams those chunks in real-time to a FastAPI backend in Python. ffmpeg converts the audio to raw LPCM 16kHz, which gets streamed to Amazon Nova Sonic for speech-to-speech processing. Nova Lite parses the transcript into a structured JSON intent, and Playwright connects to the live Amazon Music tab via Chrome DevTools Protocol to execute the action — all by injecting custom JavaScript to navigate Amazon Music's shadow DOM.
Challenges we ran into
Amazon Music's entire UI is built with custom web components inside shadow roots that standard automation tools cannot see — every single interaction required custom JavaScript evaluation. Chrome's audio pipeline was another battle — activating the microphone permanently degraded music quality until I disabled echo cancellation, noise suppression, and auto gain control entirely. Amazon Music also blocks the SpeechRecognition API on its page, forcing me to abandon wake word detection and build silence detection using an AnalyserNode instead. Coordinating Nova Sonic's streaming audio, WebSocket messages, and Playwright automation simultaneously without blocking the event loop required careful async architecture.
Accomplishments that we're proud of
Getting Nova Sonic and Playwright to work together as a seamless real-time pipeline felt like a genuine breakthrough. The moment TwinLexa heard a voice command, executed it on Amazon Music, and responded back in natural speech — all within seconds — was the moment the project became real. I'm also proud of solving the shadow DOM challenge without any third-party agent framework, writing raw JavaScript injection that works reliably across every Amazon Music interaction.
What we learned
I learned that real-world web automation is nothing like controlled environments. Shadow DOM requires a completely different approach to element selection. Chrome's audio pipeline is fragile in ways that aren't documented anywhere obvious. Real-time async coordination between streaming AI models and browser automation requires deliberate architectural decisions at every step. Most importantly, Nova Sonic taught me that speech-to-speech AI changes the feel of voice interfaces entirely — it does not feel like a command prompt, it feels like talking to someone.
What's next for TWINLEXA
Phase 1 is here — Amazon Music web users controlling their music entirely by voice. Phase 2 takes TwinLexa global, accessible to any Amazon Music user worldwide with multilanguage support. Phase 3 expands the overlay beyond Amazon Music to Spotify, YouTube Music, and Apple Music — one universal voice layer for the entire web music ecosystem. TwinLexa is just getting started.tion
What it does
How I built it
Challenges I ran into
Accomplishments that I'm proud of
What I learned
What's next for TWINLEXA
Built With
- amazon-nova-lite
- amazon-nova-sonic
- aws-bedrock
- chrome-devtools-protocol-(cdp)
- chrome-extensions-api
- fastapi
- ffmpeg
- mediarecorder-api
- playwright
- postmessage
- python
- react
- typescript
- web-audio-api
- websocket-api
Log in or sign up for Devpost to join the conversation.