Stop or mute Piper TTS from Stream Deck
Add a Stream Deck emergency-stop button for donation speech, then extend it into a persistent Piper on/off toggle.
AlphaResult
The donation reaction from the previous guide can read a viewer's message aloud through Piper. If the message contains something you do not want on stream, you need a control that works immediately without finding Streaming Hub on the desktop.
In this guide, you will add a Stream Deck button that:
- stops the speech currently playing;
- switches future Piper donation speech off;
- switches donation speech back on when pressed again.
The emergency stop works as soon as the first action is added. The persistent mute is an optional extension built with a Boolean variable.
Before you start
Complete React to donations in OBS with animation and Piper TTS first. Its Donation Reaction automation and Piper Speak action are modified near the end of this guide.
You also need:
- an Elgato Stream Deck or a compatible Ajazz controller running StreamDock;
- the matching Streaming Hub connector installed in the controller application;
- the Stream Deck bridge enabled in Streaming Hub;
- Piper configured and working.
Step 1. Install the controller connector
Download the matching package:
For Elgato, close or save any unfinished profile edits, then open the .streamDeckPlugin file and approve the installation in the Stream Deck application.
For Ajazz/StreamDock, extract the ZIP and install the included .sdPlugin folder through the StreamDock plugin workflow. If your StreamDock version does not provide an import command, close StreamDock and copy the extracted folder into:
%AppData%\Hotspot\StreamDock\plugins\
Then restart the controller application. A Streaming HUB or Streaming Hub category should appear in its action list.
Step 2. Enable the Streaming Hub bridge
In Streaming Hub, open Services → StreamDeck / Local. Enable the StreamDeck Bridge if it is disabled.
The connector needs two values from this page:
- URL, available through Copy URL;
- Token, available through Copy Token.
The default URL uses the configured Port and Path, for example:
ws://127.0.0.1:17171/streamdeck/
Step 3. Configure a Connection button
In the Elgato Stream Deck or StreamDock application:
- Add a new Streaming Hub Connection action to an unused button.
- Paste the copied value into Hub URL.
- Paste the copied value into Token.
- Select Save.
When the connector reaches Streaming Hub, the button title changes to:
HUB_OK
If it does not connect, use Test in the controller settings and Run Self-test or Open Diagnostics in Streaming Hub.
Step 4. Create the stop button
Add another Streaming Hub action to the controller:
| Setting | Value |
|---|---|
| Action | Signal |
| Button ID | piper_stop |
The Button ID is the contract between the physical button and the Streaming Hub automation. It is an arbitrary identifier, but both sides must use exactly the same spelling.
Step 5. Receive the button release in Streaming Hub
Create a new automation named Piper_Stop.
Select the StreamDeck Button Up signal and set:
| Field | Value |
|---|---|
| Button ID | piper_stop |
Button Up runs when you release the key, producing one deliberate trigger after the press.
Press the physical button once. Even while the default Log action is still present, the Logs should show that the Piper_Stop automation started.
Step 6. Stop the current speech
Delete the default Log action and add Piper Stop Speech.
Test the result:
- Start a Piper speech action or trigger a donation test containing a message.
- While Piper is speaking, press the
piper_stopStream Deck button. - The current speech should stop immediately.
At this point, the emergency stop is complete. A later donation can still start a new speech request.
Step 7. Create a persistent Piper state
To keep donation speech disabled until you explicitly enable it again, create a project variable:
| Field | Value |
|---|---|
| Name | piper_talk |
| Type | Bool |
| Initial value | true |
true allows donation speech. false blocks it.
Step 8. Toggle the variable safely
After Stop Speech, add an If branch:
| Left | Operator | Right |
|---|---|---|
vars.piper_talk | Equals | true |
Inside the If branch, add Set Variable:
| Field | Value |
|---|---|
| Target Path | vars.piper_talk |
| Value | false |
Add an Else branch with another Set Variable:
| Field | Value |
|---|---|
| Target Path | vars.piper_talk |
| Value | true |
The finished structure is:
Stop Speech
If vars.piper_talk Equals true
Set vars.piper_talk to false
Else
Set vars.piper_talk to true
End If
Step 9. Gate donation speech with the variable
Open the Donation Reaction automation from the previous guide. Select its Piper Speak action and update the run condition to:
{event.payload.message}!=event.payload.message AND {vars.piper_talk}==true
The two parts have separate jobs:
{event.payload.message}!=event.payload.messageallows Piper only when DonationAlerts supplied a real message;{vars.piper_talk}==trueallows Piper only while the Stream Deck toggle is enabled.
The rest of the donation reaction still runs while Piper is muted: OBS text updates, the animation plays, the filter changes, and the scene returns normally.
Verify the complete control
Test the full behavior in this order:
- Confirm that
piper_talkstarts astrue. - Trigger a donation message and confirm Piper speaks.
- Press
piper_stopwhile it is speaking. The current speech should stop andpiper_talkshould becomefalse. - Trigger another donation. The visual reaction should run without speech.
- Press
piper_stopagain.piper_talkshould becometrue. - Trigger one more donation and confirm that speech is enabled again.
Watch the Variables panel and Logs during testing to confirm which branch runs.
If it does not work
- The Connection button does not show
HUB_OK: confirm that the bridge is enabled, paste the complete WebSocket URL, verify the token, and restart the bridge. - The controller category is missing: install the package made for your controller application, then restart that application.
- Pressing the key produces no log entry: confirm that both Button IDs are exactly
piper_stopand that the signal is Button Up. - Speech does not stop: verify that the first action is Piper Stop Speech and that the Piper service is running.
- Speech starts again on the next donation: this is expected until you add
piper_talkto the Piper Speak condition. - The variable always returns to
true: replace consecutive conditional Set Variable actions with the If/Else structure from Step 8. - Piper never speaks again: verify that
piper_talkis a Bool, inspect its current value, and copy the combined condition exactly.
Adapt it
- Add a text or status action so the Stream Deck key displays
TTS ONandTTS OFF. - Use separate variables for donation TTS and ordinary chat TTS.
- Add another emergency button that stops an entire automation or clears a speech queue.
- Replace the toggle with two explicit buttons—Mute Piper and Enable Piper—if you prefer controls whose effect never depends on the current state.
- Put several emergency controls on one Stream Deck page: stop speech, mute alerts, return to a safe OBS scene, and disable selected automations.
Related
Download the ready-made script
Import it into Streaming Hub, then follow this guide to add your own variables and connect the required services.
Download the Piper stop script