A Flask-based web app that creates a stadium-style football announcement for the current time. It uses Groq to identify a standout player for a match or competition, then generates a short audio announcement with ElevenLabs.
- Web UI for entering a football event and generating an announcement
- Player lookup powered by Groq
- Audio synthesis with ElevenLabs
- Transcript and audio download support
- Local fallback behavior when API credentials are unavailable
- Python 3.10+
- A Groq API key
- An ElevenLabs API key and voice ID (optional for testing the text-only flow)
- Clone the repository and change into the project directory.
- Create a virtual environment:
On Windows PowerShell:
python -m venv .venv source .venv/bin/activatepy -m venv .venv .\.venv\Scripts\Activate.ps1 - Install dependencies:
pip install -r requirements.txt
- Create a local environment file:
Then update the values in
copy .env.example .env
.envwith your actual API credentials.
python app.pyThen open http://127.0.0.1:5000 in your browser.
python main.py --event "2022 FIFA World Cup Final"This generates a transcript and audio file in the output/ directory.
The app reads the following variables from .env:
GROQ_API_KEY– required for player lookupELEVENLABS_API_KEY– required for audio generationELEVENLABS_VOICE_ID– required for audio generation
You can run the basic regression test with:
python -m unittest -q test_app.pyIf Groq or ElevenLabs credentials are missing, the app will still run in a reduced mode and produce a transcript fallback instead of audio.