# Musix

Case study by [Eoin Villarin](https://amvprosox.com/about). Cross-Platform App · Open Source, 2026, Role: Creator & Full-Stack Developer. Canonical: https://amvprosox.com/case-studies/musix

Musix is a free, open-source YouTube Music player with a built-in ad blocker for Ubuntu, Windows, macOS, Android (with Android Auto) and iPhone (with CarPlay). One shared TypeScript bridge drives native apps built in Electron, Kotlin and Swift. Since 1.0.7 it saves songs for offline listening, 1.0.8 added Veru, an offline voice assistant in 38 languages, and the latest build updates itself on every platform.

## Key results

- **6** Platforms shipped
- **9** Releases in 4 weeks
- **38** Voice assistant languages
- **370+** Automated tests

## The challenge

Listening to YouTube Music without ads normally means paying for Premium, and the official apps feel different on every device. The goal was one player that looks and behaves the same on Ubuntu, Windows, macOS, Android, Android Auto, iPhone and CarPlay, blocks ads, and still respects the platform: native media controls, lock screen, background playback, car screens and voice. It had to stream through the official web player with the listener's own Google account, use no paid services, send no telemetry, keep working without internet, and let people control music hands free with a voice assistant that runs on the device instead of in the cloud.

## The solution

I built Musix as a monorepo with three shared packages and three native shells. A shared TypeScript bridge is injected into the official YouTube Music web player and turns it into a typed engine: it reads playback state from the media session and the player DOM, runs commands, parses InnerTube responses for browse, search, lyrics and suggestions, and talks to each app over a validated message contract. A shared ad block pipeline compiles filter lists into each platform's format, and a shared design token file keeps every app visually identical. On top sit an Electron desktop app for Ubuntu, Windows and macOS, a Kotlin and Jetpack Compose app for Android and Android Automotive, and a SwiftUI app for iPhone with CarPlay and Siri. Offline downloads, the Veru voice assistant (sherpa-onnx wake word, Silero voice detection and Whisper speech recognition, all on the device) and an automatic updater were added in November 2026, and GitHub Actions builds and releases every platform from one tag.

## Platforms and Downloads

Every release ships nine files from one tag: a .deb and an AppImage for Ubuntu, an installer and a portable .exe for Windows, a .dmg and .zip for macOS (Apple Silicon and Intel, macOS 12 or newer), a phone APK and a separate Android Automotive APK, and an iOS .ipa sideloaded with Impactor using a free Apple ID. Each release also publishes a latest.json file that the apps read to find updates, and a SideStore source for iPhone. The README walks through each install step, including SmartScreen on Windows, the one-time quarantine command on macOS, and unlocking unknown sources in Android Auto. The current release is 1.0.8.

## Shared Bridge and Contract

The bridge package is the heart of the project. It reads title, artist, album, artwork, time, volume, mute, like, shuffle, repeat, video id and ad state, diffs it before sending, and throttles progress to four updates per second. It supports play, pause, next, previous, seek, volume, like, dislike, shuffle, repeat, queue selection, search and in-app navigation, plus InnerTube calls for browse, search, suggestions, add to playlist, library edits and likes. Contract tests pin every message shape (ready, state, ad start and end, browse, search, lyrics, queue, errors) against recorded fixtures, so the desktop, Android and iOS apps all speak the same protocol.

## Built-in Ad Blocker

On desktop the Ghostery engine runs ads, tracking and annoyance lists, cached on disk and refreshed every 24 hours, with a live toggle, a blocked request counter and an Update now button. The shared pipeline compiles the same lists into WebKit content rules (capped at the 150,000 rule limit) for iOS and host lists for Android. A fallback catches anything the network blocker misses: it clicks the skip button when it appears, otherwise mutes the ad, plays it at 16x and jumps to the end, then restores volume and speed.

## Desktop App (Ubuntu, Windows, macOS)

The Electron shell hosts YouTube Music in a WebContentsView inside a custom frameless window with its own title bar, sidebar, top bar, player bar, queue panel and settings. It integrates with GNOME media controls and the lock screen through MPRIS, hardware media keys, a tray icon with playback controls, desktop notifications on track change, close to tray, start on login, single instance and remembered window state. Windows gets system media controls and login items. The layout is responsive from 360px with bottom navigation and a Now Playing sheet up to 2560px with a docked queue, in dark and light themes that follow the system, with overlay scrollbars, drag to scroll shelves with momentum, custom context menus, tooltips and dialogs, and keyboard shortcuts that keep working while YouTube Music has focus.

## Desktop Security

Renderers run with context isolation and no Node access, and the preload exposes a minimal typed API. Every IPC channel is typed, and the main process validates both the sender frame and the payload of every message. The shell ships a strict Content Security Policy with local fonts and icons only, Google sign-in stays inside the app while other links open in the browser, and browser shortcuts like reload, zoom, print, find, view source and devtools are blocked. The .deb installs an AppArmor profile so the Chromium sandbox works on Ubuntu 24.04 and newer.

## Android and Android Auto

The Android app is written in Kotlin with Jetpack Compose and Material 3, a WebView based engine and a Media3 MediaSession playback service, so playback shows on the lock screen, in notifications and on Bluetooth controls, and keeps going with the screen off. It handles audio focus, connectivity and artwork caching, supports voice search, and saves to playlists and the library. A separate Android Automotive build and Android Auto support use the Car App library with driving restrictions respected. Since 1.0.4 the Android UI matches iOS with the same skinned home, top bar, mini player and Home, Explore, Search, Library and Settings tabs.

## iPhone, CarPlay and Siri

The iOS app is built in SwiftUI on a WKWebView engine, with the core logic (bridge codec, command queue, browse paging, TTL cache, sign-in hosts) in a separately tested MusixCore Swift package. It supports iOS 16 and newer on iPhone and iPad, background audio, a persistent mini player, a CarPlay audio scene and Siri through INPlayMediaIntent. Release 1.0.6 fixed songs stopping a few seconds after play by ignoring stale audio interruptions, and added a playback log under Settings, Troubleshooting that records every play, pause and stall with its cause.

## Release 1.0.0 to 1.0.3

1.0.0 launched Musix for Ubuntu, Windows, Android with Android Auto, and iOS. 1.0.1 fixed Google sign-in on every platform by presenting each platform's real browser identity, removed scroll handlers that delayed every wheel tick, and made search faster without page reloads. 1.0.2 added wheel scrolling over cards, click and drag scrolling for shelves with momentum, and larger scrollbars. 1.0.3 added support for YouTube Music's redesigned player bar so play, pause, next, like, shuffle and repeat work with both versions, stopped card clicks being mistaken for drags, and restyled iOS to match desktop.

## Release 1.0.4 to 1.0.6

1.0.4 added the native macOS app for Apple Silicon and Intel and restyled Android to match iOS. 1.0.5 stopped Android songs pausing right after they start, made the status bar readable in the dark theme, updated CarPlay for current Xcode, and added screenshots for every platform. 1.0.6 added synced lyrics from LRCLIB that highlight with the song and jump when a line is tapped, search suggestions and top results while typing, instant play and pause, playback that survives the screen turning off and long sessions, automatic answers to the Are you still there prompt, and the iPhone playback fix.

## Release 1.0.7: Offline Downloads

1.0.7 added offline listening: any song can be saved as an MP3 with its thumbnail and description and played without internet. The Downloads tab finds every library (Liked Music, Recently Played, playlists and albums) with all of their songs, not just the first 100, and can download one library or everything at once, skipping songs that are already saved. Up to three downloads run at a time while the rest wait in a queue, downloads are searchable, and a log can be copied or cleared. It also fixed iPhone downloads failing with a Stream HTTP 403 error.

## Release 1.0.8: Veru Voice Assistant

1.0.8 introduced Veru, a voice assistant that works offline. Say "Veru", then play, pause, skip, shuffle, repeat, like, show lyrics, search, open a tab or change the theme. It understands exact requests such as "set volume to 50%", "forward to 1:00" or "rewind 30 seconds", handles several commands at once ("play Timeless and turn on shuffle") and asks a follow-up question when a request is unclear. The wake word, voice detection and an optional "only my voice" check run on the device with sherpa-onnx and Silero, and speech is recognised with downloadable Whisper models in 38 languages, including Tagalog and Taglish. Music dips while you speak and fades back, an on-screen card shows what Veru heard, a noise remover keeps your voice clear over loud music, and spoken replies confirm every command. Unusual requests can fall back to free AI models only, with a daily cap, and the offline commands keep working when that limit is reached. The full voice feature set is on the desktop apps today, with iPhone and Android getting the core commands first.

## Offline Mode, Themes and Downloads by Playlist

1.0.8 also made offline listening feel complete. Downloads remember which playlist each song came from, so a playlist can be played or shuffled on its own, offline shuffle plays every song once, Previous goes back through what actually played, and lyrics are saved with each download. When the connection drops, online-only tabs are dimmed and the app points to Downloads. Five themes ship on every platform (Midnight, Graphite as the default, Slate Grey, AMOLED Black and Light), and the Downloads page uses the same playlist cards on desktop, iPhone and Android.

## Automatic Updates

Musix checks GitHub for a newer release when it starts and every six hours, with an Updates section at the top of Settings. On macOS, Windows and the Linux AppImage the app downloads the new version, replaces itself and restarts, waiting until the current song is finished if music is playing; an older Mac copy updated and reopened itself in about 35 seconds in testing. Android downloads the update in the background and installs it with one tap, and iPhone users can add the Musix SideStore source to update without a paid Apple developer account.

## Testing and CI

The project has more than 370 automated tests: 241 Vitest tests for the desktop app and shared packages, 90 Android tests and 47 iOS tests. The desktop suite covers state diffing, settings and IPC validation, routing, shortcuts, MPRIS and notification policies, autostart, WCAG contrast for both themes and a scan that rejects any font under 14px. Playwright drives the real Electron app against a local fixture of YouTube Music for playback, queue, ads and navigation, plus live runs that check MPRIS over D-Bus and tray menus, and a one hour soak test that keeps memory, DOM size and message rates flat. Android runs ktlint and Robolectric unit tests, iOS runs MusixCore unit tests with warnings treated as errors, and GitHub Actions builds every platform on Ubuntu, Windows and macOS runners.

## Source Code

Musix is MIT licensed and public on GitHub at github.com/amvprosox/musixGoogle, with downloads for every platform on the Releases page. It is not affiliated with or endorsed by Google or YouTube.

## Tech stack

TypeScript, Electron, Kotlin, Jetpack Compose, Media3, Swift, SwiftUI, WebKit, CarPlay, Android Auto, Ghostery Adblocker, esbuild, Vitest, Playwright, GitHub Actions
