This project is a django server than runs locally (not remotely yet) takes your microphone stream on the backend as input and sends live translation of everything said in previous 5s to the frontend (localhost:8000) with white dubs over black background. It uses pyaudio and the library speech_recogntion and also the deepl.com api (you need an api key). For unlimited translation per months the fees starts at around 7$. The free version only allows 500 000 characters a month.
- OBS
- Python 3.10
- python pipx and poetry installed
- Go to https://www.deepl.com/en/docs-api
- Create an account (they will ask your credit card info even for the free tier).
- Go account and get the key at the bottom.
- On the server directory create a ".env" file.
- Write your api key in the file: DEEPL_API_KEY = your key.
1.Go to the server directory.
-
Run poetry init, poetry install, and poetry shell
-
Run server by running (on windows) python manage.py runserver on the console (no admin required).
-
Note the audio ID(s) corresponding to your recording device(s).
-
In the twitchlivetranslation/settings.py replace the two first python variable id with your 1 or 2 audio devices.
-
Stop (ctrl + c) and re-run server.
Now that you have the live translation server running on your machine you can start the recording and start translating. The translation starts as soon as something (obs) goes to the address http://localhost:8000
For this, simply add a browser source on OBS to this url.
- no 2 devices support yet.