An Android application that extracts text from PDF files, generates intelligent summaries, and reads them aloud using Text-to-Speech technology.
- PDF Text Extraction: Extracts text content from PDF documents using PDFBox
- Text-to-Speech (TTS): Reads summaries aloud with play/pause controls
- Modern UI: Built with Jetpack Compose and Material Design 3
- Real-time Processing: Displays loading indicators during PDF processing
- Error Handling: User-friendly error messages for various failure scenarios
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM (Model-View-ViewModel)
- Concurrency: Kotlin Coroutines
- PDF Processing: PDFBox for Android
- Text-to-Speech: Android TTS API
- Material Design: Material 3 Components
- MainActivity: Entry point that sets up the Compose UI theme
- MainScreen: Main composable containing the UI layout and interactions
- SViewModel: ViewModel managing app state and business logic
- Uses PDFBox library to load and extract text from PDF files
- Runs on IO dispatcher to prevent blocking the main thread
- Handles file URI selection through Android's document picker
The app uses a keyword-based extraction algorithm:
- Splits text into sentences
- Prioritizes sentences containing keywords: "important", "conclusion", "result", "found", "shows", "indicates", "summary", "key"
- Falls back to longest sentences if no keyword matches
- Limits summary to 3-5 sentences and 1000 characters
- Initializes TTS engine with US English locale
- Tracks speaking state with real-time updates
- Provides play and stop controls
- Handles TTS lifecycle properly
The ViewModel manages several states:
isProcessing: Shows loading indicator during PDF processingerrorMessage: Displays error messages to userssummary: Stores the generated summary textisSpeaking: Indicates if TTS is currently activettsReady: Confirms TTS engine initialization status
- π₯ Clone the repository
git clone https://github.com/yourusername/SpeakSum.git cd SpeakSum
π PDF Selection β π Text Extraction β π§ Summary Generation β π Display β π TTS Playback
We welcome contributions from the community! π
If you find this project helpful, please consider:
- Starring the repository
- Forking and contributing
- Sharing with others
- Reporting bugs
- Suggesting new features