Note to UE4 developers using Wwise audio — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Note to UE4 developers using Wwise audio

petergiokarispetergiokaris Posts: 170 Oculus Staff
edited February 2016 in Audio SDK Development
If you're using WWise, a patch is required to the UE4 source to to pause playback when losing VR focus, and redirect audio to the Rift instead of the Windows default audio device.

Please follow this link for more details:

https://forums.oculus.com/viewtopic.php?f=83&p=327557#p327557
Peter Giokaris
Senior Software Engineer

Comments

  • JustinD_RSEJustinD_RSE Posts: 2
    NerveGear
    Hi Peter,

    Do you know if there was a similar patch for Unity as the UE4 one you mention above, to correct audio device manager issues with the Rift hardware? We're seeing some issues where Wwise audio isn't being routed directly to the Rift hardware if another audio device is plugged in (headphones, external PC speaker, etc.). Running Unity 5.3.1.

    -Justin
  • petergiokarispetergiokaris Posts: 170 Oculus Staff
    edited March 2016
    Hi Justin,

    There is a way to patch Wwise / Unity integration to allow for accessing the correct audio device.

    First off, let me point you to documentation that we currently have in regards to re-targeting the audio device (note that this is for C++ integrations, but it's handy to have):

    https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-vr-audio/

    We will have more formal documentation in regards to Unity/Wwise, but here is what I can share with you which I hope will get you up and running..

    -----

    To get Wwise / Unity 5 integration to work, you need to pass the audio device name/GUID set within..


    Oculus Store->Settings->Devices->Rift Headset->VR Audio Output


    ..into the function AkSoundEngine.GetDeviceIDFromName(). This code is located within AkInitializer.cs.


    To get the audio device GUID from libOVR, you must include the Oculus Utilities unity package, which exposes that string through the class OVRPlugin.


    The following function should be called before AkSoundEngine.Init(...):


    void SetRiftAudioDevice(AkPlatformInitSettings settings)
    {        
    string audioDevice = OVRPlugin.audioOutId;

    uint audioOutId = AkSoundEngine.GetDeviceIDFromName (audioDevice);
    settings.idAudioDevice = audioOutId;

    }


    Pass AkPlatformInitSettings into the above function and use it to initialize the Ak sound engine.


    Note
    OVRPlugin.audioOutId will be deprecated in the future. However, it works at this time and it will only be a minor switch that won’t impact the integration.


    Also,


    Oculus Store->Settings->Devices->Rift Headset->VR Audio Output


    can be used to set which input mic to use within the Ak sound engine. The GUID for this is exposed through OVRPlugin.audioInId.


    -----

    Let me know if you need any clarification in the above,
    Peter

    Peter Giokaris
    Senior Software Engineer
  • JustinD_RSEJustinD_RSE Posts: 2
    NerveGear
    Thank you, Peter! This was great information!
Sign In or Register to comment.