TwinMind Voice Recorder is an Android application designed for efficient audio recording, chunked transcription, and AI-powered summary generation using the Google Gemini API. It leverages Room database for persistent storage and Jetpack Compose for a modern UI experience.
- Important: For details about classes, files, and function properties, refer to the documentation and class information.
- Android SDK 24+
Three core features:
- 🎤 Record Audio Robustly
- Background recording with explicit interruptions handling
- 📝 Generate Transcript
- Convert audio to transcript
- 📄 Generate Summary
- Create structured summary from transcript
- Foreground service for audio recording
- Split into 30-second audio chunks (with ~2-second overlap for continuity)
- Save chunks to local storage
- Persistent notification with Stop action
- Handles:
- 📞 Incoming/outgoing phone calls (pause/resume, show status)
- 🔇 Audio focus loss (pause/resume, show status)
- 🎧 Microphone source changes (Bluetooth/wired headset, show notification)
- 💾 Low storage (check before start, stop gracefully, show error)
- 💀 Process death recovery (persist session state in Room, finalize chunk, resume transcription)
- 🤫 Silent audio detection (warn after 10s silence)
- Live updates (Android 16+):
- ⏱️ Recording timer
- 🟢 Status indicator
- ⏸️ Pause/Stop actions
- 🎬 Visual indicator (icon)
- UI:
- 🖥️ Single recording/post meeting screen
- ⏺️ Record/Stop button
- ⏲️ Timer
- 🟢 Status indicator
- 📋 Dashboard listing all meetings
- Upload chunks as soon as each 30s chunk is ready
- Uses Google Gemini 2.5 Flash (commented code for free version, limit <50kb)
- Save transcript to Room database (single source of truth)
- Ensure transcript order and chunk integrity
- Send transcript to LLM API (Gemini)
- Generate structured summary
- Show specific error messages for failures
- Used Gemini for both transcription and summary
- For transcription, use commented code for free Google AI Studio (limit <50kb)
- Added icons for UI clarity
- 🎤 Audio recording and session management
- 📝 Chunked audio transcription using Gemini API (
gemini-pro:generateContent) - 📄 AI-generated structured summaries from transcripts
- 💾 Persistent storage of transcripts and summaries via Room database
- 🖥️ Clean, minimal UI with navigation between transcript and summary screens
- 🛡️ Robust error handling and demo fallback for API/network issues
- Kotlin
- Android Jetpack (Room, ViewModel, LiveData, Navigation)
- Jetpack Compose
- OkHttp (for API calls)
- Google Gemini API (v1beta)
- Gradle
- 🛠️ Android Studio (latest recommended)
- 📱 Android SDK 33+
- 🔑 Google Gemini API key (obtain from Google AI Console)
- Clone the repository:
git clone https://github.com/akv-iu/New-TwinMind.git cd New-TwinMind - Open in Android Studio:
- File > Open > Select the
New-TwinMindfolder.
- File > Open > Select the
- Configure API Key:
- Add your Gemini API key to
local.properties:GEMINI_API_KEY=your_api_key_here - Or update the key in the code (see
TranscriptionService.kt).
- Add your Gemini API key to
- Build the project:
- Click "Build" or run:
./gradlew assembleDebug
- Click "Build" or run:
- Run on device/emulator:
- Select a device and click "Run" in Android Studio.
- 🎤 Record audio sessions and view transcripts.
- 📄 Generate AI-powered summaries from transcripts.
- 🖥️ Navigate between transcript and summary screens.
Copyright © 2025 akv-iu. All rights reserved.
This software and its source code are licensed for personal and educational use only. Commercial use, redistribution, or modification without explicit permission is prohibited.
See LICENSE file for details (if available).
- Stream structured summary in the UI as the response arrives
- Continuously update the UI with new summary content
- Ensure summary generation continues and completes even if the app is killed (use WorkManager or foreground service for resilience)
- Show live recording status on the lock screen (Android 16+)
- Display recording timer (updates every second)
- Indicate current status: "Recording", "Paused - Phone call"
- Provide Pause/Stop actions directly from the lock screen
- Show a visual recording icon
- The Room database schema has evolved to support chunked audio, transcripts, and summaries.
- Important: There is currently no version control or error handling for schema/data changes. If you change the data model, you must delete all database elements before reopening the app, or it may crash.
For questions or contributions, please contact the repository owner via GitHub.