Skip to content

Instantly share code, notes, and snippets.

@udasan
Created December 23, 2016 01:13
Show Gist options
  • Save udasan/7f88ddb2abce86c541206331a0f60e11 to your computer and use it in GitHub Desktop.
Save udasan/7f88ddb2abce86c541206331a0f60e11 to your computer and use it in GitHub Desktop.
Steam VR Audio Playback Mirror Device
public string GetAudioPlaybackMirrorDevice ()
{
System.Text.StringBuilder sb = new System.Text.StringBuilder(128);
Valve.VR.EVRSettingsError er = new Valve.VR.EVRSettingsError();
Valve.VR.OpenVR.Settings.GetString(
Valve.VR.OpenVR.k_pch_audio_Section,
Valve.VR.OpenVR.k_pch_audio_OnPlaybackMirrorDevice_String,
sb,
(uint)sb.Capacity,
"",
ref er);
return sb.ToString();
}
public void SetAudioPlaybackMirrorDevice (string serial)
{
Valve.VR.EVRSettingsError er = new Valve.VR.EVRSettingsError();
Valve.VR.OpenVR.Settings.SetString(
Valve.VR.OpenVR.k_pch_audio_Section,
Valve.VR.OpenVR.k_pch_audio_OnPlaybackMirrorDevice_String,
serial,
ref er);
Valve.VR.OpenVR.Settings.Sync(false, ref er);
}
public void ClearAudioPlaybackMirrorDevice ()
{
SetAudioPlaybackMirrorDevice("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment