Voice-To-Prompt-Pipeline
October 22, 2025 · View on GitHub
Convert audio recordings into structured AI prompts using Gemini 2.5 Pro's multimodal audio capabilities.
Overview
This CLI tool processes audio recordings of AI prompts and transforms them into well-structured markdown documents. It uses Google's Gemini 2.5 Pro model to transcribe and reformat the audio according to a specific template that separates core requests from contextual information.
Features
- Interactive file selection from the
in/directory - Multimodal audio processing using Gemini 2.5 Pro
- Automatic transcription with filler word removal
- Structured output with summary, requests, and context sections
- Timestamped output files in markdown format
Prerequisites
- Python 3.8 or higher
- uv (recommended) or pip
- Google Gemini API key
Setup
- Create a virtual environment using uv:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
uv pip install -r requirements.txt
Alternatively, if not using uv:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Configure your Gemini API key:
Copy the example environment file and add your API key:
cp .env.example .env
Then edit .env and replace the placeholder with your actual Gemini API key:
GEMINI_API_KEY=your-actual-api-key-here
Usage
- Activate the virtual environment (if not already activated):
source .venv/bin/activate
-
Place your audio file(s) in the
in/directory -
Run the CLI:
python process_audio.py
-
Select the audio file you want to process from the interactive menu
-
The structured prompt will be saved to the
out/directory with a timestamp
Supported Audio Formats
- MP3
- WAV
- M4A
- OGG
- FLAC
- AAC
- WMA
- OPUS
Output Format
The generated markdown file follows this structure:
Summary
A two-line summary of the prompt containing core requests and contextual data.
Requests
Organized task list of AI requests.
Context/Background
Organized presentation of context data, which may reference specific tasks.
System Prompt
The tool uses the system prompt defined in system-prompt.md. This ensures Gemini processes the audio according to your specific requirements for formatting and organization.
Example
$ python process_audio.py
==================================================
Voice to Prompt Pipeline
==================================================
System prompt loaded from: system-prompt.md
Available audio files:
--------------------------------------------------
1. 1.mp3 (8.60 MB)
--------------------------------------------------
Select a file (enter number): 1
Processing: 1.mp3
Uploading audio to Gemini...
Uploaded file: files/abc123xyz
Generating structured prompt...
==================================================
Success! Output saved to: out/1_20251022_165500.md
==================================================
Directory Structure
Voice-To-Prompt-Pipeline/
├── .venv/ # Virtual environment (created by uv)
├── in/ # Place audio files here
├── out/ # Processed prompts output here
├── .env # Environment variables (API key) - not in git
├── .env.example # Example environment file
├── .gitignore # Git ignore rules
├── system-prompt.md # System prompt for Gemini
├── process_audio.py # Main CLI script
├── requirements.txt # Python dependencies
└── README.md # This file
Security Note
The .env file containing your API key is excluded from git via .gitignore. Never commit your actual API key to version control.