cancel
Showing results for 
Search instead for 
Did you mean: 

How can I implement VRC.PC.Audio.1 with Unity and Wwise?

viteichris
Protege
(sorry for the double post, original topic was a discussion instead of a question)

VRC.PC.Audio.1 is our last remaining VRC, but I'm struggling to find any info on how to set our project up to pass.

We're using:
  • Wwise 2017.2.0
  • Unity Integration Bundle: 2017.2.0.947
  • Unity 2017.3.0f3
  • OVR Plugin 1.22
We're not using
the OculusSpatializer plugin for wwise, but our audio director is happy
with the way the game sounds and we successfully pass VRC.PC.Audio.2
(Audio specialization).

The only two pieces of relevant info I can find on the internet are in this post from January:
Feedback from our internal team:
"...it’s implemented under the hood and Unity automatically targets the
Rift audio device. Unity redirects their audio to the Rift by default.
If you use a third-party audio subsystem such as Wwise or FMOD, the
latest version
also does this. If you're using another audio system,
they need to follow the guide [linked above]."
I'm not sure if
"latest version" refers to Wwise, Unity or OVR, but everything we're
using (afaik) is latest as of January this year.

and in this doc page:

Unity 5 and Wwise

To
configure Wwise to use to configured audio device in Unity 5, pass the
user-configured audio device name/GUID (set in the Oculus app) into the
function AkSoundEngine.GetDeviceIDFromName(), located in AkInitializer.cs.

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

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

[...]


But we're on Unity 2017, so the code snippet doesn't work, and (I think) shouldn't be necessary anymore.

--
Neither
of these sources has helped get me closer to solving the problem. 
Since there's so little info around, and because Wwise say their tool
has been used in hundreds of games, it feels like it must be something
that's (usually) automatically handled but somehow we've missed a step
of flicked a switch off somewhere that no-one else does.

If
anyone has any info on how we can move on with this, or even how to
debug it a bit more, it would be very gratefully received!

Thanks,
1 ACCEPTED SOLUTION

Accepted Solutions

viteichris
Protege
Update:
I re-tried the above snippet of code and it's working perfectly now!  No idea why it didn't work before..

Hopefully this will help someone else too : )

View solution in original post

5 REPLIES 5

viteichris
Protege
Update:  I updated everything (Unity, wwise, wwise-unity, oculus, ovrplatform) to the latest available version and made a new build.

I still fail the VRCValidator check.
If
checking it manually I still hear audio through my speakers/headphones
with Windows set to "default audio device" and the Oculus Home app set
to "Use Rift Audio".

Not sure if there's even anything else I can change to fix this...

viteichris
Protege
I've also tried this in place of the code snippet from the docs:
string audioDevice = OVRManager.audioOutId;
uint audioOutId = AkSoundEngine.GetDeviceIDFromName(audioDevice);
initSettings.settingsMainOutput.idDevice = audioOutId;
(just dropped into akSoundEngineController.Init(...) at line 150).

This results in no sound output at all, but
initSettings.settingsMainOutput.idDevice
is the only other accessible reference to a device id that I could find 😕

viteichris
Protege
Update:
I re-tried the above snippet of code and it's working perfectly now!  No idea why it didn't work before..

Hopefully this will help someone else too : )

viteichris
Protege
Hi!

Thanks for getting letting me know!  I posted my "somehow it works now" post before I saw yours, I guess all that needs to be done is to update the Wwise x Oculus page with the up-to-date code from my post (or whatever the recommended method is now that Wwise has changed)

Luis.Zan
Protege
I'm wondering if you can help clarify some things.

I'm having the same issue failing VRC.PC.Audio.1 (The application targets the wrong audio device) while using Unity 2019.1 and Wwise 2019.1 (with the Oculus spatializer)

I've looked through the  AkInitializer.cs file and found no reference to AkSoundEngine.GetDeviceIDFromName() nor AkSoundEngine.Init in it.

My question is, what script file should I be looking for the function 
akSoundEngineController.Init in order to drop this code snippet? 

Or is the issue now supposed to be solved in a different way?

Whenever I open my application build the audio output does change to the Rift automatically so I'm unsure why I keep failing this test.

Thanks,