$ show pounat/absorb
Absorb is a production-grade Flutter mobile application that serves as a full-featured client for self-hosted Audiobookshelf servers. It streams and downloads audiobooks and podcasts, providing offline playback, sleep timer, bookmarking, chapter navigation, built-in equalizer, on-device speech-to-text transcription via whisper.cpp, and an ebook reader. The architecture is a cross-platform Flutter app with extensive native platform code (Kotlin for Android, Swift/ObjC for iOS) that deeply integrates with Android Auto, Apple CarPlay, Wear OS, Chromecast, and home-screen widgets. Audio playback is managed by a highly customized audio_service plugin with a native iOS audio engine (AbsorbAudioEngine) that handles cross-book transitions and equalizer effects. The transcription feature uses a forked whisper_ggml_plus package with a voxel-activity detection and MP3 slicer for frame-accurate clip extraction. The codebase demonstrates high craftsmanship in platform-level audio handling, but its reliance on multiple vendored plugins (audio_service, just_audio, flutter_carplay, whisper_ggml_plus, flutter_epub_viewer) creates maintenance overhead due to duplicated native code across platforms and occasional divergence from upstream versions.
The LLM identified 3 files worth highlighting for reuse:
Implements byte-level MP3 slicing without external dependencies, identifying MP3 frame boundaries using sync bits and side info parsing. This is critical for the transcription feature, which needs exact audio windows. The logic is self-contained and reusable in any Android project requiring precise MP3 segment extraction.
Uses Android MediaCodec in a streaming loop to decode any audio format (e.g., M4A, MP3) to 16 kHz mono PCM WAV, with configurable start and end offsets. This decouple the extraction from specific container formats and is reusable for any app needing to extract raw audio clips from media files. It handes the full decode pipeline: extractor, decoder, downmix, resample, and WAV writing.
A singleton AVPlayer-based audio engine for iOS that manages playback of multi-track audiobooks (e.g., across chapters), supports equalizer processing tap, cross-book transitions without gaps, and position reporting. It decouples platform audio logic from the Flutter layer and can be extracted as a reusable native audio controller for any iOS app requiring advanced playback orchestration.