Syrinscape Pro Tip #23 - Using Audio Router to switch the playback for Syrinscape in windows

Ok. We all know that Syrinscape does not have a way to select an audio playback. So, many of us use programs like Voicemeeter Banana to separate audio and then assign Syrinsacpe to a virtual audio cable. To do this, though, before we launch Syrinscape we need to remember to change the windows default playback to whatever we assigned Syrinscape to and once Syrinscape is fully launched, we need to change it back. I’m human and sometimes I forget to put the playback default back, accidentally shut down Syrinscape, etc…

There is an alternate way to select the audio playback device for Syrinscape using audio router. It works well for me. There are still a few steps involved but it still prevents me from having to remember the playback device thing, launching and relaunching Syrinscape, etc. Step by step instructions on using with Voicemeeter Banana are attached. I hope this helps some of you! Note - I don’t know if there is a download for audio router for the Mac, so I reference windows only in my post.

2 Likes

FYI: Windows 10 now has a native way of doing this. (As of Windows 10 version 1803 … if you don’t see the option, check if there’s a pending upgrade through Windows Update!)

Under Settings -> System -> Sound, there’s an option for “App volume and device preferences”

You can then change the Syrinscape player to output from whichever device - be it physical or a virtual cable.

It will remember this setting every time you load it.

1 Like

Additional screenshot:

1 Like

That’s great! thanks for sharing :slight_smile:

1 Like

Hey, Jye. Thanks for posting. I’m definitely aware of that functionality in windows 10, but unless something changed, it doesn’t work for syrinscape. I’ve tried it several times and it does show that the input device is set but syrinscape still only opens up in whatever default device is set when you launch it. If you have confirmed that this functionality actually works now definitely let us know. I just tried it myself and it still doesn’t work for me. Keep us posted though!

Ok, I stand corrected - that is the strangest thing I’ve seen. It does control the volume just fine (which is what I was testing originally, since I only have one decent sound device), but doesn’t seem to obey which device it was told to use.

Which version of Unity is it built with? There was a bug regarding sound outputs that was fixed in a newer release, which this could be related to.

No problem at all. I appreciate you searching for things that improve syrinscape! I’ll let someone else chime in on the Unity version… Not sure…

1 Like

On windows you can use nircmd (see bottom of the page for download) and a batch file to set up a nice shortcut to change default output device, launch syrinscape and finally change the default output device back.

Steps to do this:

  1. Download nircmd and extract nircmd.exe to a folder.
  2. Make 2 new text documents and change the file extension to .ncl
  3. Add the text shown below to the 2 files.
  4. Create a new file and change the extension to .bat.
  5. Add the text shown below to the bat file.

Now, whenever you need to start syrinscape with another default output device and change back, you just click the bat file.


In the following files, it is assumed that you want to hange syrinscape to the audio output named “CABLE Input” and that the default audio should revert back to the output named “Speakers”.

Capture

File 1 - Speakers.ncl

setdefaultsounddevice “Speakers”

File 2 - Syrinscape.ncl

setdefaultsounddevice “CABLE Input”

File 3 - Syrinscape.bat

<path_nircmd>\nircmd.exe” script “<path_nircmd>\Syrinscape.ncl”
TIMEOUT 2
START “” “<path_syrinscape>\Syrinscape Sci-Fi Player.exe”
TIMEOUT 5
<path_nircmd>\nircmd.exe” script “<path_nircmd>\Speakers.ncl”

<path_nircmd> should be replaced with the path to the folder with nircmd and the files.

<path_syrinscape> should be replaced with the path to syrinscape. If you want to open syrinscape fantasy player that should also be changed in the bat file.

Note that the timeouts in that bat file are used to delay the changes to the sound output. I didn’t experiment too much with the timing, but since syrinscape usually takes more than 5 seconds to load, the parameters used above have not been annoying to me.

3 Likes

Interesting. Seems like a cool little utility. Thanks for sharing!

1 Like

Thanks for the hint about Nircmd but for me, it didn’t work. (Windows 10 x64 build 1909 as of 2020-04-09)

Here’s what I did to make it work using a Powershell script:

  1. Head on over to https://github.com/frgnca/AudioDeviceCmdlets/releases/ and grab the latest version of AudioDeviceCmdlets

  2. Once the .dll file is downloaded, follow the instructions here to install: https://github.com/frgnca/AudioDeviceCmdlets#import-cmdlet-to-powershell
    NOTE: You DO NOT need to run this in an elevated shell to complete this task.

  3. After step 2 is complete and you’ve got AudioDeviceCmdlets installed you’ll need to identify which INDEX values correspond to your audio devices by opening a Powershell window and typing the following command: Get-AudioDevice -List

Depending on how many physical and virtual audio devices you’ve got, you may need to scroll to find the ones you want. Note the INDEX value assigned to your device.

For me, I have VoiceMeeter Potato installed with Cables A, B, C, and D and a pile of audio hardware installed so I’ve got over 25 virtual and physical audio devices. I found my inputs way up at the top at Index 1 and Index 3.

Now that you’ve got the associated index values for the device you want to keep as your default and your desired device to output Syrinscape to, you’re going to create a nifty Powershell script in order to do three things: A) Set the audio device to the device you want Syrinscape to output to, B) Run Syrinscape, and finally C) Set the audio back to the default device that you want your other sounds to come from:

  1. Click on the start button and start typing PowerShell (don’t press enter). Click on PowerShell ISE.

  2. In the PowerShell ISE window, click View > Show Scripting Pane

  3. Paste the following into the Scripting Pane (top white box):
    Set-AudioDevice -Index 3 TIMEOUT 2 START "C:\Program Files (x86)\SyrinscapeFantasyPlayer\Syrinscape.exe" TIMEOUT 20 Set-AudioDevice -Index 1

  4. Change your index values to match the values that you retrieved with the “Get-AudioDevice -List” command to match your desired devices.

Feel free to tweak the timing- if you have an enormous number of Syrinscape sounds or perhaps a slow computer, you might need more time!

You may also need to change the path to your Syrinscape executable as well, depending on where you’ve got it installed. Mine is default.

  1. Save the PowerShell script somewhere that you’ll be able to find it again. (File > Save As…) Call it Syrinscape.ps1 and make a note of where you saved it.

  2. Create yourself a batch file so that you can run your PowerShell script with a simple double-click: Right click inside any folder and select New > Text Document. This will create a new .txt file that you can rename to something snappy like “LaunchSyrinscape.bat” (Remember to wipe out the .txt and replace it with .bat otherwise it won’t run)

  3. Right click your new .bat file and select Edit. (If, for some strange reason you don’t have that option, open the file in notepad or your favourite text editor).

  4. Paste the following into your empty batch file:
    powershell -noexit "& ""C:\<path-to-your-PowerShell-Script>\Syrinscape.ps1""" exit
    Save and close your batch file.

If you followed along closely and didn’t skip any steps you should now be able to double-click on your batch file and your fancy new script will launch Syrinscape for you with your audio device of choice playing some excellent sounds for your table!

If you have problems, start over from step 1. Make sure you don’t miss any quotation marks or flake out on any of the steps to install the .dll file into your system. (Chances are, you messed up on Step 2 if you’re having problems so go slow, take your time, do it right.)

Enjoy!