Friday, May 27, 2016

Switching Audio to Rift when Launching ED

This technique is a workaround for programs launched directly from Windows. Programs launched from within Oculus Home switch audio automatically. Unfortunately I do not have a solution for SteamVR games. If you find a way I'd be interested to know.

Steps
1. Download and install AudioSwitch
2. Run AudioSwitch from the commandline to display audio devices
cmd.exe
cd "C:\Program Files (x86)\AudioSwitch"
audioswitch /l
3. Take note of your device numbers
C:\Program Files (x86)\AudioSwitch>Audioswitch.exe /l
C:\Program Files (x86)\AudioSwitch>
 Devices available:
  0  Headphones (Rift Audio)
  1  Realtek Digital Output(Optical) (Realtek High Definition Audio)
  2  Realtek Digital Output (Realtek High Definition Audio)
 <3> Speakers (6- Bose USB Audio)
  4  Headset Earphone (2- ASTRO Wireless Transmitter )
In my case the Rift is device 0 while my speakers are device 3.

4. Create a .BAT file on your desktop and enter the following lines.
@echo off
cd "C:\Program Files (x86)\AudioSwitch\"
echo Switching Audio to Rift
Audioswitch.exe /s 0
echo Starting ED Launcher
"C:\Program Files (x86)\Frontier\EDLaunch\EDLaunch.exe"
Audioswitch.exe /s 3
5. Double-click on the BAT file to Run
The batch file should open a cmd window. Your default audio device becomes the Rift. Then the Elite Dangerous Launcher starts. When the Elite Dangerous Launcher is closed, the script switches default audio back to speakers before closing.

Update: If you want to launch programs like VoiceAttack, Captail's Log and such before the ED Launcher use following syntax:
start "" "Program Executable"
My current launcher looks like this
@echo off
cd "C:\Program Files (x86)\AudioSwitch\"
echo Switching Audio to Rift
Audioswitch.exe /s 0
start "" "C:\Program Files (x86)\VoiceAttack\VoiceAttack.exe"
echo Starting ED Launcher
"C:\Program Files (x86)\Frontier\EDLaunch\EDLaunch.exe"
Audioswitch.exe /s 3

No comments: