A Next.js application that records voice memos, processes them with Google's Gemini API, and extracts key information.
- Node.js 18 or later
- FFmpeg installed on your system
- On macOS:
brew install ffmpeg - On Ubuntu/Debian:
sudo apt-get install ffmpeg - On Windows: Download from FFmpeg's official site
- On macOS:
- Google Cloud account with:
- Storage bucket configured
- Service account with appropriate permissions
- Gemini API enabled
-
Clone the repository:
git clone [repository-url] cd ai-voice-memo-app -
Install dependencies:
npm install # or pnpm install -
Set up environment variables:
cp .env.local.example .env.local
Then edit
.env.localto add your Google Cloud and Gemini API credentials. -
Run the development server:
npm run dev # or pnpm dev -
Open http://localhost:3000 in your browser.
- Create a Google Cloud Project
- Create a Storage bucket for audio files
- Set up appropriate CORS configurations:
[ { "origin": ["http://localhost:3000", "https://your-production-domain.com"], "method": ["GET", "POST", "PUT", "DELETE"], "responseHeader": ["Content-Type", "Authorization"], "maxAgeSeconds": 3600 } ] - Generate a service account key with Storage Admin permissions
- Add the service account credentials to your
.env.localfile
- Get a Gemini API key from Google AI Studio
- Add the API key to your
.env.localfile
- Record: Click the microphone button on the home screen to start recording
- Review: After recording, use the playback controls to review
- Process: Click "Save and Process" to send the recording for AI processing
- View: Review the transcription, summary, and extracted tasks
- Save: Save the processed note for future reference
/app- Next.js app routes and pages/components- React components/ui- shadcn/ui components
/hooks- Custom React hooks/lib- Utility functions and services/services- Service integrations for Google Cloud and Gemini
The voice recording implementation follows this flow:
- Audio is recorded using the browser's MediaRecorder API
- The recording is visualized in real-time using the Web Audio API
- Upon completion, the audio is saved as a Blob
- The audio is uploaded to Google Cloud Storage
- The GCS URL is sent to Gemini API for processing
- Results are displayed to the user