Ever wanted to subtitle your stream in your language and add one or two other languages with automatic translation? Looks like there’s a tool for that.
Step 1: Setting up a Apps Script (Google)
Setting up the Apps Script start with creating a new script on Apps Script: https://script.google.com
In the editor you will need to paste the following code:
function doGet(e) { const params = e.parameter var translatedText = LanguageApp.translate(params.text, params.source, params.target); const output = ContentService.createTextOutput(); output.setMimeType(ContentService.MimeType.JSON); output.setContent(translatedText); return output; }
The code will need to be deployed by click on the deploy menu on the top left:
The app must be deployed as a web app:
In the form you must let anyone access it:
When it’s deployed you will be provided the app key, this is what you will need for the next steps:
Step 2: Setting up the page
This is where the fun begins. There’s a form that is totally in Japanese that will require a couple of edits to be usable. Go here to start filling the form: https://sayonari.coresv.com/ninshikiChan/20210822_config.html
In the input field for Google Script API-KEY paste the one from your Apps Script. If you didn’t copy the key in the previous step you can retrieve if by going into the editor, in the deploy menu you need to click on manage deployments and you’ll find it under deployment ID:
Change the languages you want to use lower on the page, feel free to use Google Translate to find out what is what:
On the bottom of the page you will find the URL that you can copy and paste in your web browser, Google Chrome might be the only supported browser at the time of writting.
Step 3: Setting up OBS
Now comes the less fun part. Since the web page needs to listen to your voice you will have to run the page in your own Google Chrome instance, I’m unsure if it works on other browser since I wasn’t able to make the web app perform every single time.
To set it up all you need is a window capture and some filters. If the content of the web browser doesn’t appear you might need to disable hardware acceleration.
For the filters I usually just crop the top and a bit of the bottom, then I apply a chroma key filter to remove the screen background:
Congratulations, you are know streaming while subtitling at the same time. Subs are the way to go and this is what it looks like:
Troubleshooting
Refreshing the tab might help making the web app work, but if your speech isn’t appearing on screen you should instead try closing and reopening your browser.
I kept the tab loaded before closing Google Chrome and when I opened it again it was working.
Once again this isn’t flawless and some words might appear wrong or be heard wrong, these are the limits of speech recognition. Unless we slap some machine learning over your accent.
It might also strain your performances and require relaunching Google Chrome once in a while.
Credits
This is basically a translation of a Japanese page that was shared with me: http://www.sayonari.com/trans_asr/index_asr.html
This is a very useful tool for hearing impaired viewers and to enable people to appreciate better a stream in another language.