Back to .md Directory
Pitch Narration Generator
Parses a structured video script, extracts all `Narrator:` blocks, and synthesises them into a single MP3 using Azure OpenAI TTS.
ai openai
View sourcePitch Narration Generator
Parses a structured video script, extracts all Narrator: blocks, and synthesises them into a single MP3 using Azure OpenAI TTS.
How it works
- Split the script on
Time: ...section headings - Extract each
Narrator:block - Synthesise each block via Azure OpenAI TTS →
output/section_NN.mp3 - Concatenate with a short pause between sections →
output/narration.mp3
Setup
1. Install dependencies
pip install openai python-dotenv pydub
pydubrequires ffmpeg for MP3 export:brew install ffmpeg # macOS
2. Configure credentials
cp .env.example .env
Fill in your Azure OpenAI TTS resource key and endpoint.
Usage
python video_gen.py script.txt
Your script file should use this format:
Time: 0:00-0:30 | Section Title
(Visual: optional stage direction — ignored)
Narrator: The text that will be spoken aloud.
Time: 0:30-1:00 | Next Section
Narrator: More narration here.
Output
output/
├── section_00.mp3 ← per-section audio clips
├── section_01.mp3
│ …
└── narration.mp3 ← final stitched narration
Configuration
| Setting | Where |
|---|---|
| TTS voice | voice= in synthesise() — options: alloy, echo, fable, nova, onyx, shimmer |
| TTS speed | speed= in synthesise() |
| Pause between sections | PAUSE_MS constant |
Related Documents
VIDEO_SCRIPT.md
Demo Video Script - Kinetic Ledger
**Duration:** 3-5 minutes
aiagent
0
12
RydlrCSVIDEO_SCRIPT.md
Demo Video Script (30-60 Seconds)
- **Loom** (free) - loom.com
aicursor
0
4
dev-ayomideVIDEO_SCRIPT.md
CodeForge AI - Hackathon Demo Script
**[Fade in: Dark background with CodeForge AI logo animating in]**
aiagent
0
4
zaikamanVIDEO_SCRIPT.md
Prompt Craft Reference
Production-quality prompt engineering for HeyGen Video Agent. Combines official HeyGen guidance with patterns validated across 80+ test videos.
aiagentrag
0
4
heygen-com