Skip to content

andresveraf/CV-TO-TTS

Repository files navigation

πŸŽ™οΈ CVAudioStudio - Professional Text-to-Speech Converter

Streamlit Python License

A professional, web-based text-to-speech converter powered by OpenAI's TTS API. Perfect for creating audio versions of CVs, interview preparation materials, study notes, and practice questions.

✨ Features

  • 🎀 Multiple Voice Options - Choose from 6 different professional voices
  • πŸ”Š 3 Quality Models - Economy, Standard, and Premium TTS models
  • ⚑ Speed Control - Adjust playback speed from 0.25x to 4.0x
  • πŸ“Š Cost Estimation - Real-time cost calculator for informed decisions
  • πŸ“œ History Tracking - View, play, and manage all generated audio files
  • πŸ’Ύ Multiple Formats - Support for MP3, Opus, AAC, FLAC, WAV, PCM
  • 🎯 Character Counter - Live character/word count and duration estimation
  • πŸš€ Easy Deployment - One-click deployment to Streamlit Cloud

🎯 Use Cases

  • Professional Audio - Convert CVs and resumes to audio
  • Interview Prep - Practice with audio versions of common interview questions
  • Study Materials - Listen to notes, textbooks, and study guides
  • Language Learning - Hear correct pronunciation of foreign language texts
  • Accessibility - Create audio versions of written content
  • Content Creation - Generate voiceovers for presentations and videos

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/yourusername/CVAudioStudio.git
cd CVAudioStudio
  1. Install dependencies
pip install -r requirements.txt
  1. Set up your API key
cp .env.example .env
# Edit .env and add your OpenAI API key
  1. Run the application
streamlit run streamlit_app.py
  1. Open your browser Navigate to http://localhost:8501

πŸ“– Usage

Generate Audio

  1. Enter your text - Paste your CV, study material, or any text (up to 5000 characters)
  2. Choose a voice - Select from 6 professional voice options
  3. Select model - Economy (cheapest), Standard, or Premium (best quality)
  4. Adjust speed - Control playback speed (0.25x - 4.0x)
  5. Generate - Click "Generate Audio" and wait a few seconds
  6. Download - Play in browser or download the audio file

View History

  • Click "πŸ“œ View History" in the sidebar
  • See all previously generated audio files
  • Play, download, or delete files
  • Search and sort by date or size

πŸ’° Pricing

CVAudioStudio uses OpenAI's TTS API with transparent pricing:

Model Price Quality Best For
gpt-4o-mini-tts $5.00/1M chars High Most use cases
tts-1 $15.00/1M chars Standard Professional audio
tts-1-hd $30.00/1M chars Premium Best quality

Example costs:

  • Typical CV (500 chars): ~$0.01 (Economy model)
  • Study notes (2000 chars): ~$0.03 (Economy model)
  • Interview prep (1000 chars): ~$0.02 (Economy model)

🎨 Available Voices

Voice Gender Accent Description
alloy Neutral American Clear and articulate
echo Male American Deep and authoritative
fable Male British Warm and engaging
onyx Male American Confident and professional
nova Female American Friendly and clear
shimmer Female American Expressive and warm

πŸ“ Project Structure

CVAudioStudio/
β”œβ”€β”€ streamlit_app.py          # Main application
β”œβ”€β”€ pages/
β”‚   └── 1_πŸ“œ_History.py      # History page
β”œβ”€β”€ utils/
β”‚   └── audio_generator.py    # TTS generation logic
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ openai_voices.py     # Voice configurations
β”‚   └── voices.py            # Voice metadata
β”œβ”€β”€ audio/                    # Generated audio files
β”œβ”€β”€ text/                     # Sample text files
β”œβ”€β”€ logs/                     # Application logs
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ .env.example             # Environment variables template
β”œβ”€β”€ README.md                # This file
β”œβ”€β”€ QUICKSTART.md            # 5-minute setup guide
β”œβ”€β”€ DEPLOYMENT.md            # Deployment instructions
└── DEPLOYMENT_COMPARISON.md # FastAPI vs Streamlit comparison

πŸš€ Deployment

Streamlit Cloud (Recommended - Free & Easy)

  1. Push code to GitHub
git add .
git commit -m "Initial commit"
git push origin main
  1. Deploy to Streamlit Cloud
    • Go to share.streamlit.io
    • Click "New app"
    • Connect your GitHub repository
    • Select streamlit_app.py
    • Add your OpenAI API key in "Secrets"
    • Deploy!

Your app will be live at: https://cvaudiostudio.streamlit.app

For detailed deployment instructions, see DEPLOYMENT.md.

πŸ› οΈ Development

Local Development

# Install development dependencies
pip install -r requirements.txt

# Run with auto-reload
streamlit run streamlit_app.py --server.runOnSave true

# View logs
tail -f logs/app.log

Adding New Voices

Edit config/openai_voices.py to add custom voice configurations.

Customizing Models

Modify utils/audio_generator.py to add new model options.

πŸ“š Documentation

πŸ”§ Configuration

Environment Variables

Create a .env file:

# Required
OPENAI_API_KEY=your_api_key_here

# Optional
OPENAI_ORG_ID=your_organization_id
LOG_LEVEL=INFO
MAX_TEXT_LENGTH=5000

Streamlit Configuration

Edit .streamlit/config.toml to customize:

[theme]
primaryColor = "#1f77b4"
backgroundColor = "#ffffff"

[client]
showErrorDetails = false

[logger]
level = "info"

πŸ› Troubleshooting

Common Issues

"OpenAI API key not found"

  • Ensure .env file exists with your API key
  • Restart the application after adding the key

"Error generating audio"

  • Check your OpenAI API key is valid
  • Verify you have sufficient API credits
  • Check the logs in logs/app.log

Audio not playing

  • Try a different browser
  • Check browser console for errors
  • Ensure audio format is supported

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • OpenAI for the TTS API
  • Streamlit for the amazing framework
  • The open-source community

πŸ“§ Support

For issues, questions, or suggestions:

⭐ Show Your Support

If you find this project useful, please consider:

  • ⭐ Starring it on GitHub
  • 🐦 Sharing it on Twitter
  • πŸ’¬ Telling your friends and colleagues

Built with ❀️ using Streamlit and OpenAI TTS API

⬆ Back to Top

About

A professional, web-based text-to-speech converter powered by OpenAI's TTS API.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors