CoolFace
Apppublic

amcrabtree88/text-to-audio

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

๐ŸŽต 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 .txt files 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

  1. 1.Upload a Text File - Click the upload area and select a .txt file
  2. 2.Preview Content - Review your text before processing
  3. 3.Generate Audio - Click the "๐Ÿš€ Generate Audio" button
  4. 4.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:

bash
git clone https://github.com/yourusername/text-to-audio
cd text-to-audio
pip install -r requirements.txt

Running Locally

bash
streamlit run src/streamlit_app.py

The 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.