Instruction file imported from donghaozhang/gemini-tts-multi-speaker (
.cursor/rules/development-workflow.mdc). Copyright stays with the author.
Development Workflow
Environment Setup
- API Key Configuration: Copy .env.example to .env and add your Gemini API key
- Dependencies: Install with
pip install -r requirements.txtfrom requirements.txt - Testing: Use batch files for quick testing of different scenarios
File Organization
- Source Code: All Python files in project root
- Generated Audio: All WAV files automatically saved to
result/directory - Documentation: README.md and PROJECT_STRUCTURE.md
Git Workflow
The .gitignore excludes:
- Environment files (
.env) - Audio files (
*.wav,*.mp3) - too large for version control - Python cache (
__pycache__/) - IDE files and temporary files
Adding New Scenarios
To add new conversation scenarios:
- Single Speaker: Add functions to gemini_tts_example.py
- Multi-Speaker: Add demo functions to multi_speaker_demo.py
- Academic Content: Add presentations to academic_papers_demo.py
Batch Script Pattern
All batch files follow this pattern:
@echo off
echo Loading environment variables from .env file...
for /f "delims=" %%x in (.env) do (set "%%x")
echo Running [Description]...
python [script_name].py
pause
Testing Strategy
Use run_demos.bat to launch any of the demos or run them all at once.
Code Style
- Functions use descriptive names with clear purposes
- Error handling includes user-friendly messages
- Voice names are converted to lowercase for API compatibility
- Output files are saved with descriptive names in
result/directory
Extension Points
- Add new voice combinations in speaker arrays
- Create new dialogue scenarios with different themes
- Implement additional audio processing features
- Add support for different output formats