Developer Overview
This section provides information for developers who want to contribute to TTS Wrapper or integrate it into their projects.
Development Environment
Using UV (Recommended)
-
pip install uv
-
Clone the repository:
git clone https://github.com/willwade/tts-wrapper.git
cd tts-wrapper -
Install Python dependencies:
uv sync
-
Install system dependencies (Linux only):
uv run postinstall
To generate a requirements.txt file:
uv export --format requirements-txt --all-extras --no-hashes
Note: This will include all dependencies including dev ones.
Using Pip
-
Clone the repository:
git clone https://github.com/willwade/tts-wrapper.git
cd tts-wrapper -
Install the package and dependencies:
pip install .
For optional dependencies:
pip install .[google,watson,polly,elevenlabs,microsoft]
Project Structure
tts_wrapper/
├── engines/ # TTS engine implementations
│ ├── avsynth/ # macOS AVSpeechSynthesizer
│ ├── espeak/ # eSpeak-NG
│ ├── google/ # Google Cloud TTS
│ └── ...
├── ssml/ # SSML handling
├── exceptions.py # Custom exceptions
└── tts.py # Base TTS interface
tests/ # Test suite
website/ # Documentation site
examples/ # Example scripts
Development Guidelines
-
Code Style
- Follow PEP 8 guidelines
- Use type hints
- Include docstrings for all public methods
- Keep methods focused and single-purpose
-
Testing
- Write unit tests for new features
- Include integration tests for engine implementations
- Test with both online and offline scenarios
-
Documentation
- Update relevant documentation files
- Include code examples
- Document any new features or changes
-
Error Handling
- Use custom exceptions where appropriate
- Provide meaningful error messages
- Handle both expected and unexpected errors
Tools and Dependencies
-
Development Dependencies
- pytest: Testing framework
- black: Code formatting
- mypy: Type checking
- docusaurus: Documentation site
-
Runtime Dependencies
- sounddevice: Audio playback
- numpy: Audio processing
- requests: HTTP client
Next Steps
- Learn about adding new engines
- Understand our release process
- Check out how to contribute