amcrabtree88/text-to-audio
0
๐ต Text to Audio Converter
Convert your text files to high-quality audio using the lightweight Kokoro-82M text-to-speech model.
Features
โจ Key Capabilities:
- ๐ค Upload
.txtfiles with your text content - ๐ต Fast text-to-speech conversion powered by Kokoro-82M
- ๐ Real-time progress tracking during audio generation
- ๐ Built-in audio player for preview
- โฌ๏ธ Download generated audio as MP3
- ๐ GPU-accelerated inference (auto-detects CUDA)
How to Use
- Upload a Text File - Click the upload area and select a
.txtfile - Preview Content - Review your text before processing
- Generate Audio - Click the "๐ Generate Audio" button
- Download MP3 - Once generation completes, download your audio file
Model Details
- Model: Kokoro-82M by HexGrad
- Type: Lightweight text-to-speech (TTS)
- Sample Rate: 24kHz
- Output Format: MP3 (192k bitrate)
- Inference: CPU & GPU supported
Installation
Clone the repository and install dependencies:
git clone https://github.com/yourusername/text-to-audio
cd text-to-audio
pip install -r requirements.txtRunning Locally
streamlit run src/streamlit_app.pyThe app will open at http://localhost:8501
Requirements
- Python 3.8+
- PyTorch
- Transformers
- Streamlit
- SciPy
- Pydub (for MP3 encoding)
See requirements.txt for specific versions.
Troubleshooting
Model Takes Time to Download: The Kokoro-82M model (~300MB) downloads on first run. Subsequent runs use the cached model.
Out of Memory: If you run out of VRAM, the app will automatically fall back to CPU inference.
No Audio Output: Ensure your text file contains valid UTF-8 encoded text.
License
This project uses the Kokoro-82M model. Please refer to the model's license on HuggingFace.
Support
For issues, questions, or contributions, please visit the repository or check the Streamlit documentation.
