← Back to post

It's honestly depressing how bad stock TTS APIs are across the board. Paperback on mobile has truly shown me this; I outline how the iOS side of this works in the quoted post, and Android is its own flavor of hacky: we synthesize ahead to temporary WAV files and chain MediaPlayer instances with setNextMediaPlayer() to kill the inter-paragraph silence put there with the stock player. On both platforms, getting a seamless reading experience means treating the system TTS purely as a text-to-speech renderer and building the player yourself.

Quin@TheQuinbox@dragonscave.space

@simon Spot on! Instead of letting iOS handle playback directly, I use AVSpeechSynthesizer purely as a speech renderer writing raw PCM audio buffers into memory, which then feed into a custom AVAudioEngine pipeline, which aggressively prefetches multiple paragraphs ahead (and behind for instant rewinds) to survive iOS throttling background synthesis when the screen is locked, resamples them to the hardware rate, and pre-arms the next buffer directly onto the audio node while the current one is still playing. That last one is also why transport controls like pausing and resuming mid-word feel instant. Say what you will about Voice Dream, but at least prior to it getting bought, have hardly used it since, it was the only app I ever saw get this right, and I wanted Paperback to as well. Android testing on your part would definitely be nice, but both of the primary Paperback developers use android as our daily devices, so that one has gotten more testing by nature of us relying on it.