A full-stack voice translation assistant powered by IBM Watsonx, Watson Speech-to-Text, and Watson Text-to-Speech. Speak or type in English and receive a spoken translation back.
config.py ← EDIT THIS FIRST — all credentials and settings live here
server.py ← Flask backend (3 routes)
worker.py ← STT / TTS / Watsonx functions
index.html ← Frontend UI (self-contained — CSS & JS embedded)
requirements.txt ← Python dependencies
.gitignore
README.md
python3 -m venv my_env
source my_env/bin/activate # Windows: my_env\Scripts\activate
pip install -r requirements.txtOpen config.py and fill in your own values:
WATSONX_API_KEY = "YOUR_WATSONX_API_KEY" # IBM Cloud IAM API key
WATSONX_PROJECT_ID = "YOUR_PROJECT_ID" # Watsonx.ai project ID
STT_BASE_URL = "https://..." # Your Watson STT endpoint
TTS_BASE_URL = "https://..." # Your Watson TTS endpoint
TARGET_LANGUAGE = "Spanish" # Change translation target hereWhere to get credentials:
- API key → IBM Cloud IAM
- Project ID → IBM Watsonx.ai → your project → Manage → General
- STT / TTS endpoints → deploy using IBM Watson Speech Libraries for Embed or use the IBM Skills Network CloudIDE defaults already in
config.py
python server.pyOpen http://127.0.0.1:8000 in your browser.
If you are running inside the IBM Skills Network CloudIDE, the default endpoint values in config.py already work — you only need to set WATSONX_API_KEY and WATSONX_PROJECT_ID, or leave PROJECT_ID = "skills-network" as-is if the environment has pre-authorised access.
In config.py:
TARGET_LANGUAGE = "French" # or "German", "Arabic", "Mandarin", etc.Then select a matching voice from the dropdown in the UI.
| Voice ID | Language | Gender |
|---|---|---|
en-US_OliviaV3Voice |
US English | Female |
en-US_MichaelV3Voice |
US English | Male |
en-GB_CharlotteV3Voice |
British English | Female |
es-ES_EnriqueV3Voice |
Castilian Spanish | Male |
es-LA_SofiaV3Voice |
Latin American Spanish | Female |
fr-FR_NicolasV3Voice |
French | Male |
de-DE_DieterV3Voice |
German | Male |
List all available voices:
curl https://<your-tts-endpoint>/text-to-speech/api/v1/voicesApache 2.0