A Flask web application that generates stories and provides text-to-speech functionality using multiple TTS services.
My son likes to listen to story before he sleeps, especially with his mom's voice. So I created this app with standard google tts service first and implement voice clone function with f5 tts.
- Story generation with AI
- Multiple TTS services:
- Google Text-to-Speech (gTTS)
- F5 Text-to-Speech
- User authentication system
- Voice profile management
- Audio streaming
- Database integration for story storage
- Clone the repository:
git clone https://github.com/yourusername/story-generator.git
cd story-generator
- Install dependencies:
pip install -r requirements.txt
- Set up configuration:
cp config_template.py config.py
Edit config.py with your API keys and settings
Start the development server:
python run.py
The application will be available at http://localhost:5000
Start the f5 tts server:
python f5tts_api.py
You need to install f5-tts first. For the installation of f5 tts, you can refer to the official f5 tts library
story-generator/
├── app/ # Main application package
│ ├── auth/ # Authentication module
│ ├── db/ # Database operations
│ ├── story/ # Story generation logic
│ ├── tts/ # Text-to-speech services
│ ├── utils/ # Utility functions
│ └── static/ # Static files (CSS, JS, images)
├── scripts/ # Database management scripts
├── voice_profiles/ # Voice profile assets
├── config_template.py # Configuration template
├── requirements.txt # Python dependencies
└── run.py # Application entry point
Edit config.py
to set up:
- Database path
- API keys
- TTS service preferences
- Application settings
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
I have very limited knowledge about the frontend, so almost everything in the frontend is generated by cursor. The backend is also generated by cursor first and I review/modify/debug it. If anyone can help improve the frontend, I will appreciate it.