Start, pause and stop live translation from a Stream Deck
A button at the sound desk is quicker than the studio’s page: one press starts the service through a studio left standing by, one pauses the translation for the announcements, one resumes it, one ends the service, and a light shows whether it is on air. This guide sets that up on a Stream Deck through Bitfocus Companion, with a key your church owns. The Companion steps follow Companion’s own help; nobody here runs a Sunday through Companion yet, so try it on a weekday first.
What you need
- Bitfocus Companion, free, on the computer the Stream Deck is plugged into. The Stream Deck’s own software can open a web address, but as far as we know it cannot send a key in a header (check Elgato’s help), so on its own it is not enough: use Companion, or a Stream Deck plugin that sends a POST with headers, and check that plugin’s own help.
- A key for the buttons, made by an owner of the church in the studio’s Settings, under Integrations. We will open the API to a few churches first: if Integrations is not there yet and you would like yours to be one of them, write to us.
- A second key, for Start, if a button should start the service. A key that may start reads no transcripts, and a buttons key cannot start unless “Start a service” is ticked for it. Ticked on the buttons key, it gives that one key Start beside pause, resume and stop; Start is best kept on a key of its own, so you can revoke it alone. How to make it is under “Starting from a button”, below.
- Your room’s id. One command shows it, below.
- The internet on the desk’s computer. The buttons reach Translate Hub over the internet, as the studio does.
Make a key for the buttons
- In the studio, open Settings, then Integrations, and choose “New key”.
- Give it a name the desk will recognise, such as “Sanctuary deck”. The stage shows this name whenever the key pauses, resumes or ends a service.
- Under “What it may do”, choose “Buttons (Stream Deck, Companion)”. Such a key sees whether a service is on air, and can stop, pause and resume it and change its spoken language. It reads no transcripts. Leave “Start a service” unticked here if Start is to have a key of its own, as below.
- Choose its room, or leave every room, and choose “Make key”. If the studio asks you to sign in again, do so when no service is on air: a key is made only after a recent sign-in.
- Copy the key at once. It is shown this one time only.
Find your room’s id
Keep the key in an environment variable named TRANSLATE_HUB_KEY, so it is in no command you share, and ask for your rooms. The first line is for PowerShell on Windows, the second for a terminal on a Mac or Linux.
curl.exe -H "Authorization: Bearer $env:TRANSLATE_HUB_KEY" https://translate-hub.com/api/v1/roomscurl -H "Authorization: Bearer $TRANSLATE_HUB_KEY" https://translate-hub.com/api/v1/roomsThe answer lists each room by its name and its id. The id goes into each button below, where ROOM_ID stands.
Add Translate Hub to Companion
- In Companion’s Connections, add the Generic HTTP Requests module (search for HTTP).
- In the connection’s settings, set Base URL to https://translate-hub.com/api/v1/ and leave Authentication at None. The key goes in each button’s header instead.
The three buttons
- Make a button, and add the module’s POST action to what it does when pressed.
- In its URI, write rooms/ROOM_ID/pause, with your room’s id in place of ROOM_ID.
- In “header input(JSON)”, write the last line below, with your key in place of YOUR_KEY. Companion wants valid JSON there, and sends nothing otherwise. Leave Body empty.
- Make two more buttons the same way, one with rooms/ROOM_ID/resume and one with rooms/ROOM_ID/stop.
rooms/ROOM_ID/pauserooms/ROOM_ID/resumerooms/ROOM_ID/stop{"Authorization": "Bearer YOUR_KEY"}The key goes in the header, never in the address. A key that appears in the address of a call to our API is revoked on the spot, and the press is refused: addresses end up in logs, where others can read them. A key put in any other address is yours to revoke in Settings. Companion keeps the header in the button’s settings, so an export of Companion’s configuration may hold the key: check before you share one.
What each button does
- Pause stops hearing and translating until the service is resumed, and the phones are told.
- Resume lifts any pause: one made in the studio too, or by another key. Put it only where whoever presses it may lift the operator’s pause.
- Stop ends the service, as the studio’s Stop does. Put it apart from the other two. Start is best kept on a key of its own, so you can revoke it alone, and it needs the studio standing by: see below.
- The stage says who pressed. When the deck pauses the service, the studio shows “Paused by Sanctuary deck”, and the same goes for Resume and Stop.
Starting from a button
A button can start the service too, but never by itself: it asks a studio that someone at the church has left standing by, on the computer with the microphone, to press “Start the service”, as a person at the desk would. The studio’s own Start then checks the plan and the languages as it always does, and nothing that studio hears is sent until the service starts. Remote start comes with a paid plan: on the free trial a press is refused with remote_start_paid_only, and the service is started in the studio.
- An owner sets the room’s hours: in Settings, Integrations, under “Remote start hours”, one or more weekly windows, such as Sundays from 9 AM to 1 PM, in the church’s time zone. A key may start the room only inside them, and a room without hours cannot be started by a key.
- Make the key for Start the same way as the first one, with a name of its own, such as “Sanctuary start”, and tick “Start a service” under “Buttons (Stream Deck, Companion)”.
- On Sunday, on the computer with the microphone, open the studio in the room and turn the microphone on. Under “Start the service”, switch on “Remote start”, fill in “This computer’s name”, choose “For how long”, at most 12 hours, and press “Turn on”. Leave the tab open and the microphone on. When that time is up, a person switches it on again. If the studio says “Not yet tried on this browser: test it once on a weekday.”, do that before a Sunday.
- One computer stands by for a room. Switching Remote start on at another computer moves it there: the studio asks first, and the first computer’s switch turns off.
- In Companion, make a fourth button with the POST action, the URI on the first line below, and the start key in “header input(JSON)”, as on the second line, with your start key in place of YOUR_START_KEY. Leave Body empty.
rooms/ROOM_ID/start{"Authorization": "Bearer YOUR_START_KEY"}- No studio standing by. A press is refused with studio_not_ready: “Open the studio on the computer with the microphone and turn on Remote start.” During one of our updates, a start can need a second press: press again a little later.
- Already on air. A press while the service is on air, or starting, changes nothing and is not an error.
- Outside the hours, or with the desk’s lock on. A press outside the room’s hours is refused with outside_start_hours. While the desk has turned remote control off, Start is refused with control_locked, as the other buttons are.
- The limits. A room can be started from a button only so often in a minute and in a day, by the room’s own clock; the figures are on the developers’ page. After that, start the service in the studio.
- The stage says so. For the whole service, the studio shows “Started remotely by Sanctuary start at 9:58 AM. If nobody here expected this, press Stop and turn off remote control.”
- A start that cannot begin is shown too. If the studio cannot begin, for instance when the microphone does not start or the room has no listener languages, the stage says why, and lastStart in the status reads failed, with the reason.
- Every owner is emailed. Every owner of the church is emailed each time a key starts a service, with the key’s name and the room. These emails cannot be turned off.
A light for “on air”
- In Companion’s Triggers, add a trigger whose event is “Time interval”, every few seconds.
- As its action, add the module’s GET action with the URI rooms/ROOM_ID/status and the same header. Name a custom variable in “JSON Response Data Variable”, and turn “Store result as text” off, so the answer is kept as JSON.
- Colour a button from that variable: live is true while the service is on air, paused while it is paused, controlLocked while the desk has turned remote control off, and studioReady while a studio stands by and a press of Start would reach it.
How to read one field of a JSON variable and colour a button by it differs between versions of Companion, so check Companion’s own help for that step. Asking for the status every few seconds is well inside the limits on the developers’ page.
Turning the buttons off
Anyone who runs services can turn the buttons off in one press: “Turn off remote control”, in the studio’s church menu, and on the stage beside the line that names the key. From then on every press is refused, and the status light still works. Only an owner turns it on again, in Settings, Integrations.
When the deck is gone, or the key may have leaked, revoke it in Settings, Integrations. Every call is on the developers’ page and in the API reference, in English.