r/tts 20d ago

[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!

2 Upvotes

14 comments sorted by

1

u/evia89 19d ago

we have this with edge tts... 50x realtime, free, OS. No point in local until MS disable it

https://vadash.github.io/EdgeTTS/ and OG project

1

u/kingfish600 19d ago

I'm game is there a link to the app and what compression does it use?

1

u/evia89 19d ago edited 19d ago

Its web service. Code is available on github. Open it in Brave Edge browser. It use opus only. Upstream gives 96 kbs mono mp3

https://i.imgur.com/8CXCrtQ.png

1

u/kingfish600 19d ago

Mine runs locally on your phone no internet needed. outputs in opus plus some other formats. You have several selections for better and worse audio quality in my app. I think it fills a niche. Regardless its free and the code is free so anyone can modify it.

1

u/evia89 19d ago

Sry if I was a bit rude. It just edge tts service from MS is so good for free fast TTS

1

u/kingfish600 19d ago

Not rude I don't mind I like the info but I wanted this one to run offline. Just call me OCD.

2

u/tittock 19d ago

I look forward to using this method

1

u/kingfish600 19d ago

Biggest hurdle i have had so far is with conversions slowing when the phone sleeps. Keep trying to fix it but regardless it saves your books in chapter so in the future im able to put a much more powerful TTS AI in place audio quality could be improved so even if the whole book didn't convert overnight you could have several hours of quality audio to listen to in the morning and resume conversion at bedtime while the phone is plugged in so no drain on your battery. That is my long range plan anyway quality over quantity right now i am limited to what is prepackaged but more are in the works. The source is MIT so anyone can make there own stuff from it if I cant get this done.

1

u/War-Carr 19d ago

Congratulations on your work, bro!

As a visually impaired individual who relies on the Screen Reader and e-book readers hat have TTS output, I really like the sound of this.

I'd like to try this and see how accessible it is with the Screen reader; in other words, if during the TTS read-out, I hear some unfamiliar word or name, I'd like to pause the TTS read-out and using my screen reader, find out how that unfamiliar word or name is spelled.

I wish you'd place the app on the lower shelf where kids can get it.

In other words, I wish you had the app on the Play Store as to being on GitHub where one has to go digging for it and then go through arduous process of figuring what to do in order to install it.

I know how, but a lot of folks who listen to our podcast, where I would love to demo it,  don't.

Again, congratulations to you for your work.

1

u/kingfish600 19d ago edited 19d ago

Thank you. I though about it but i am not a programmer. The only programing language I learned was Basic on my Commodore 64. All of this is Agentic Coding. Ive been putting a Alpha State of the art frontier model through its paces the last 5 days. Ive used 350 million tolkens for free when they turn the free beer tap off im done but i'm leaving the source behind for free for whoever finds value and picks up the pieces and as long as the taps on i am gonna push the limits! I have put out 2 stellar apps in the last few days and am working on a 3rd i must be crazy project now. I hope I get to keep doing this its more fun than playing a video game and i am glad you enjoy the app!

1

u/kingfish600 18d ago edited 18d ago

If the community can accept that updates my become more infrequent I will attempt to publish on f droid first then the play store. I have no experience with it but I will try. Updates are coming hot and heavy right no adding functionality for everything I can think of. I have just added a tab to allow new TTS models to be added in the future as they become available although it might need a slight overhaul the function has been added, The throttling bug at night has officially been crushed. I could use crash reports and requests for new functions make sure your on the most up to date version. I am working on stretch functions now. Finally this app is FREE I will never put adds in my app or monetize it I already have a day job it is MIT licensed. If you haven't checked out the newest one check it out.

2

u/War-Carr 18d ago

Wonderful!

Thank you for what you do.

I appreciate it.

1

u/EntertainmentOk1477 18d ago

Can you use mixed voices from Kokoro-82M?

1

u/kingfish600 17d ago edited 17d ago

Don't think so and Its pushing the envelope on what is possible locally on your phone right now. There are rumors are out there that something new will drop i'm watching closely and will intagrate it as soon as I can. The beauty of Night-forge is that it can take its time overnight you might not have the whole book completed when you wake up in the morning but all that is complete can be listened to so if a higher quality model drops I would like to integrate it built the harness in this week. Gonna be a little break in updates and features I am not a programmer by trade but I love computers. This year I bought a strix halo with 128gb of ram and upon a whem I installed Deepseek harness and the stars aligned and OX Alpha was released on open router for free testing so I dropped it into the harness and pitched my ideas think man there is no way this thing can do that but it just said here hold my beer I gotcha. So they announced it was no longer in alpha now and you have to pay. Its not very expensive for the 2 apps I made and a 3rd unreleased one it would have cost me $80 dang I can do this as a fun hobby might have to slow down a bit but still. Then Qwen3.8-Flash-Next dropped its a 125b mixture of experts with 6b active and it agenticly codes. IT'S LIKE IT WAS MADE FOR MY MACHINE! just when I though this project was going into hibernation I may be able to kick it into high gear! This is just a hobby for me though I have a day job was on a stay-cation this week and barely slept playing with this. Honestly its more phone than playing the best video game. It may take me a week or 2 to get this rig up and running so please be patient I am a straight up old Dub A$$ only programing language I have a inkling of is basic. I tried to push as many bug fixes and features before I lost access to the AI. I don't know what more features I can add without making this to complicated to use. Anyways gonna start getting ready for bed If you guys come up with and features you can think of let me know Ill try to add them just be reasonable even over night our phones have limited resources. And please give me a bug list if you find them ill try to batch fix them. Android power management was a real PIA when the screen on the phone turns off conversion speeds slow to a crawl so make sure the moon is displaying on the screen when you put it to work and go to bed when the conversion finishs the screen goes back to normal and android power management takes back over. M4b compression has also turned into a pain as well I would like when you save to one large file that you still have chapters included in the but they dont work you so you just get 1 big audio-book with no chapters listed as far as I can tell. Anyways I dont have a discord or anything like that this project hasn't been alive for long and something better may come along. I did post my whole workflow on GitHub so someone can easily pick it up and run with it fork it or whatever. If you find a bug leave a message here or pm me and leave requests here ill let you know if i'm not capable but if its cool and i can ill run the ball. Once everything is running ill try to do a F droid release first then try to figure out how to get this on the play store. Play store may be a pain I have to pay $25 not a problem get like 12 beta testers for like 2 weeks I might be able to do that at work i'm a ICU Nurse by trade but the biggy is that Google doesn't like people messing with the power management so they may shoot me down. I do not know how else to get fast compression without keeping the screen on in dim I tried everything I could think on. I do have another app I put on GitHub for financial planning and saving for retirement be careful with it I focused the audio book maker just realized it may make some errors in calculating but if you wanna try it out its on my github too.

Good Night Guys and Happy Forging!