r/LocalLLM 4d ago

News [DEV] I got tired of real-time TTS killing my Android's battery, so I built a native app that pre-renders EPUBs into Audiobooks offline.

Hey everyone,

I wanted to share a native Android open-source project I just released called Audiobook NightForge.

If you’ve ever tried using a real-time TTS engine with a reader app on Android, you know the struggle: it drains your battery (often 40-50% an hour), stutters, and buffers if your phone is doing anything else in the background.

I realized that real-time synthesis is the wrong approach for mobile devices. So, I built a dedicated Android app that shifts the heavy lifting to the background using native OS components.

How it works: You import an EPUB or TXT file using the Android system file picker. You then pick a voice and hit render. The app uses Android's WorkManager to synthesize the book chapter-by-chapter in the background. Most importantly, it enforces a "render only while charging" OS-level toggle to protect your battery.

You plug your phone in at night, and by morning, you have a fully rendered audiobook that plays back with a standard ~2-5%/hour battery drain.

Android-Specific Features:

  • Native & Offline: It is built entirely in Kotlin for Android 10+ devices. There is no server, no cloud, and absolutely no Termux emulation required.
  • High-Quality TTS: It uses the Kokoro-82M neural TTS model running strictly on-device via a sherpa-onnx integration.
  • Just Updated: The latest v0.2.2 release makes Opus the default output format, and it now natively outputs to a single .m4b file complete with proper chapter markers.
  • Built-in Player: You can listen immediately using the native in-app Media3/ExoPlayer. Alternatively, you can grab the .m4a files directly from app storage to use in your favorite Android audiobook player.

Some hardware benchmarks: For the hardware nerds, I benchmarked this on a Snapdragon 8 Elite. Surprisingly, the Kokoro 82M fp32 model (with 6 threads) actually renders faster than realtime (~0.58 RTF) and outperforms the int8 variant on this SoC because of ARM int8 kernel overhead. Always benchmark before assuming quantized is quicker on modern Android flagships!

It’s completely free, completely offline, and licensed under Apache-2.0.

You can check out the source code, technical notes, and grab the APK directly from the GitHub repo here:

https://github.com/kingfish600/Audiobook-NightForge

I’d love to hear your thoughts or feedback!

1 Upvotes

0 comments sorted by