>_ DevTrendspl

Język

Strona główna

Języki

Sekcje

Frontend Backend Mobilne DevOps AI / ML GameDev Blockchain Systemy wbudowane Bezpieczeństwo
Kotlin

How to Organize Your Audio Library on Android with Lyrico

If you still store music locally on your phone as FLAC or MP3 files, you've probably dealt with the eternal tag chaos. A downloaded album suddenly splits into five different artists in your player, there's no cover art, and instead of lyrics you see gibberish or nothing at all.

Desktop tools like MusicBrainz Picard or Mp3tag handle this problem well. But connecting your phone to your computer every time you add a few new tracks is frankly tedious. On Android itself, decent tag editors have almost disappeared: old apps are abandoned, and new ones are either packed with ads or can only do basic track title editing.

I recently discovered the Lyrico project by developer Replica0110. It's a fresh open-source app built with Kotlin that handles the tedious work of editing metadata and fetching lyrics directly on your smartphone.

What's Inside and Why the Project Is Interesting

At first glance, Lyrico looks like a neat editor with a HyperOS-style interface (using the Miuix component library for Jetpack Compose). But under the hood, there's a serious combination of native libraries and an embedded engine.

The app can:

  • Scan device memory and group tracks by folders, albums, or artists
  • Read and rewrite any tags in MP3, FLAC, OGG/Opus, M4A/AAC, and WAV formats via the battle-tested TagLib library
  • Analyze track loudness using the EBU R128 standard via the libebur128 library
  • Batch rename files, bulk-edit tag fields, and remove garbage
  • Work with synchronized lyrics in standard LRC, line-by-line, and even complex TTML formats with karaoke timings

What especially stands out is how the author approached online information retrieval.

JavaScript Plugins Inside QuickJS

Instead of hardcoding APIs for specific Chinese or Western music services (which regularly change endpoints and break parsing), the Lyrico creator moved all network logic into plugins.

Each plugin is a small JavaScript script. The author embedded the lightweight quickjs-ng engine (a QuickJS fork by Fabrice Bellard with modern JS standards support) inside the Android app.

How the process works:

  1. You install a data source plugin via manifest.
  2. The app passes a search query to the isolated QuickJS environment.
  3. The script goes online, parses metadata, covers, or lyrics, then returns standardized JSON.
  4. The native Kotlin layer receives the result and writes it to the audio file.

This approach gives two benefits. First, if a source changes its API, you just update a small JS file without rebuilding the entire APK. Second, any developer can whip up a parser for their favorite site or local Navidrome/Subsonic server in an evening. The repository already has detailed documentation on the host API and manifest structure.

Integration with Local Players

Another detail that sets this project apart: Lyrico can work as an external metadata editor for third-party players.

Instead of inventing its own built-in audio player, the developer focused on the utility side and added integration points via Android Intent. Several independent open-source players (for example, Halcyon, Mica Music, Raws-Music, and Prism Music) already know how to open the current track directly in the Lyrico editor for quick fixes.

How to Build the Project Locally

Building the app is standard for Android projects with a complex NDK stack. You'll need:

  • JDK 21
  • Android SDK and Android NDK 29
  • CMake 4.1.2

The module structure is straightforward:

  • lyrico-app — UI on Jetpack Compose, music library management, plugin runtime
  • lyrico-audiotag — wrapper over C++ libraries for reading and writing tags
  • docs — plugin API documentation based on VitePress

You can build a debug APK with this terminal command:

./gradlew :lyrico-app:assembleDebug

If you just want to test Kotlin code compilation without full native library linking:

./gradlew :lyrico-app:compileDebugKotlin

The code is distributed under the Apache License 2.0.

Is It Worth Trying

Lyrico comes in handy in two cases. If you listen to music offline and are tired of messy tags, it's one of the most convenient solutions on Android right now. The second reason to look at the project is the engineering: you can see a great example of embedding QuickJS in a modern Compose app and clean organization of work with native C++ libraries via JNI.

The project is still fresh, part of the documentation is being translated from Chinese, but the architectural idea looks very practical. You can install the APK right from the releases page on GitHub.

Powiązane projekty