Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Set an audio device

    Advanced Programmer

    You can set which audio device Stride uses. For example, you can access the Oculus Rift audio device from your custom game constructor.

    If you don't specify a device, Stride uses the default audio advice.

    Example code

    This code sets the Oculus Rift device at runtime:

    namespace OculusRenderer
    {
        public class OculusGame : Game
        {
            public OculusGame()
            {
                var deviceName = OculusOvr.GetAudioDeviceFullName();
                var deviceUuid = new AudioDevice { Name = deviceName };
                Audio.RequestedAudioDevice = deviceUuid;
            }
        }
    }
    

    See also

    • Global audio settings
    • Improve this Doc
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation