Want to expand the functionality of your Elgato Stream Deck by using it as a quick-shot sound board? Awesome. So did I.
So How Do You Do It?
With a tiny command-line MP3 player.
Sadly, the Stream Deck doesn't currently have a 'Play a Sound' function in the software. We don't know when (or if) Elgato will add this function, so it's up to us to take it into our own hands with a duct-taped-together workaround! Thankfully, Jim Lawless makes a tiny command-line MP3 player that runs without popping open a window, starts almost instantly, is open-source, and is FREE, called cmdmp3win.
If you want to get fancy with it, you can create .bat files for each sound, but that could possibly slow down the triggering of the sound effect. It could also open its own window, potentially popping you out of your game or being annoying, which can't be worked around without getting into more advanced scripting.
I'll cover that down below. First, there's something more important!
But FerretBomb, I can't STOP my sound from playing! It just keeps going, and is a 5-minute long song!
Seriously? Pick a shorter song. Think ahead. Or...
Create a new Open action on an empty button, and put this in the App/File box:
That tells Windows to find any running processes named 'cmdmp3win.exe' and stop (kill) them. Apparently there are brakes on this train. But they're emergency-brakes, and WILL pop open a CMD window for a split second, potentially popping you out of a full-screen game. Windowed mode should be fine. If you're streaming and using a capture card for the monitor or using a Display Capture source, your viewers may see the window as it flickers for a split second. Provisos done. Go have fun!
Here's a better way to do it, through WMI with VBScript! Just save the below as Soundboard_stop.vbs in a text editor, and create an Open action on the Stream Deck pointing at it.
No more cmd window! No more getting dumped out of full-screen games to stop a sound! I fixed the brakes!
Thanks, Guy Thomas! :D
But I want to do it through .BAT files!
Okay, as promised above. This is also a good way to add a sound effect to opening a different program entirely, but it's an even dirtier jury-rig than the last one. How do we do it? WRAP THE WRAPPER! Specifically, we call the .bat from a .vbs, that temporarily tells WshShell to run the Script Host in silent mode. Blah blah on with the code!
Now make an Open action on your Stream Deck, pointed at the mybatch.vbs file.
Advanced part done! PUSH THE BUTTON, FRANK!
Hopefully this helped! If so, stop by my stream on Twitch (http://www.twitch.tv/ferretbomb) sometime and say hi, drop a follow if you want, and be sure to let me know!
So How Do You Do It?
With a tiny command-line MP3 player.
Sadly, the Stream Deck doesn't currently have a 'Play a Sound' function in the software. We don't know when (or if) Elgato will add this function, so it's up to us to take it into our own hands with a duct-taped-together workaround! Thankfully, Jim Lawless makes a tiny command-line MP3 player that runs without popping open a window, starts almost instantly, is open-source, and is FREE, called cmdmp3win.
- Go download cmdmp3new from his blog: https://lawlessguy.wordpress.com/2015/06/27/update-to-a-command-line-mp3-player-for-windows/
- Unzip it into a directory, where it will live. I'd recommend C:\cmdmp3 just for simplicity.
- In the Stream Deck software, create an Open action on a button.
- In the App/File box, type in "C:\cmdmp3\cmdmp3win.exe" "C:\path\to\your\MP3\goes\here.mp3" (including the quotes!)
- Push the button, Frank. DONE.
- (OPTIONAL, BUT RECOMMENDED) Make a button to play a lengthy MP3. Play it. Check your systray. Double click the 'LAV' icon. Uncheck the 'system tray icon' box. Otherwise a new icon will appear in the tray each time you play a sound, even if they all vanish when you mouse over them. With the box unticked, no icon hassle!
If you want to get fancy with it, you can create .bat files for each sound, but that could possibly slow down the triggering of the sound effect. It could also open its own window, potentially popping you out of your game or being annoying, which can't be worked around without getting into more advanced scripting.
I'll cover that down below. First, there's something more important!
But FerretBomb, I can't STOP my sound from playing! It just keeps going, and is a 5-minute long song!
Seriously? Pick a shorter song. Think ahead. Or...
Create a new Open action on an empty button, and put this in the App/File box:
Code:
C:\Windows\System32\taskkill.exe /IM cmdmp3win.exe /F
Here's a better way to do it, through WMI with VBScript! Just save the below as Soundboard_stop.vbs in a text editor, and create an Open action on the Stream Deck pointing at it.
Code:
' ProcessKillLocal.vbs
' Sample VBScript to kill a program
' Author Guy Thomas http://computerperformance.co.uk/
' Version 2.7 - December 2010
' ------------------------ -------------------------------'
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'cmdmp3win.exe'"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WScript.Quit
Thanks, Guy Thomas! :D
But I want to do it through .BAT files!
Okay, as promised above. This is also a good way to add a sound effect to opening a different program entirely, but it's an even dirtier jury-rig than the last one. How do we do it? WRAP THE WRAPPER! Specifically, we call the .bat from a .vbs, that temporarily tells WshShell to run the Script Host in silent mode. Blah blah on with the code!
Code:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\My Batch Files\mybatch.bat" & Chr(34), 0
Set WshShell = Nothing
- Put that into a text file in Notepad and save it as mybatch.vbs.
- Replace "C:\My Batch Files\mybatch.bat" with the name and path to your batch file.
- Make sure mybatch.bat contains something like this:
Code:
@Echo Off
"C:\cmdmp3\cmdmp3win.exe" "C:\path\to\your\MP3\goes\here.mp3"
Exit
Advanced part done! PUSH THE BUTTON, FRANK!
Hopefully this helped! If so, stop by my stream on Twitch (http://www.twitch.tv/ferretbomb) sometime and say hi, drop a follow if you want, and be sure to let me know!