# Playing audio to different virtual devices on PS4

**URL:** <https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204>\
**Category:** Unity\
**Created:** [November 21, 2018, 1:23pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204 "2018-11-21T13:23:42Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![oddraven](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@oddraven](https://qa.fmod.com/u/oddraven)\
**Post date:** [November 21, 2018, 1:23pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/1 "2018-11-21T13:23:42Z")

</div>

We have a game where we have one VR player and one screen player. We play different audio to the players. On Windows this is handled through playing each players’ sound on a different audio device, but how should this be done on PS4? The getNumDrivers function returns only one driver even though we have headphones connected to the VR-set and/or the gamepad.  
What is the best way to achieve this?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 25, 2018, 10:16pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/2 "2018-11-25T22:16:08Z")

</div>

The PS4 only has one output driver, other audio devices can be routed to using the FMOD port API. Audio devices include the controller, headsets, or other personal devices.

The FMOD PS4 API download has this in the Platform Specific Starter Guide of the documentation.

---

<div class="post-metadata">

**Author:** ![oddraven](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@oddraven](https://qa.fmod.com/u/oddraven)\
**Post date:** [November 26, 2018, 4:11pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/3 "2018-11-26T16:11:34Z")

</div>

Thank you, I found the relevant section of the documentation but I have a hard time getting it to work. The docs says to switch to Audio3D output mode by calling System::setOutput before initializing, so in the RuntimeManager I added:  
`lowlevelSystem.setOutput(FMOD.OUTPUTTYPE.AUDIO3D);`  
right before the call to studioSystem.initialize, but if I do the initialization fails with the following error:

> SystemNotInitializedException: FMOD Studio initialization failed : Calling initialize : ERR\_PLUGIN : An unspecified error has been returned from a plugin.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 27, 2018, 10:28pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/4 "2018-11-27T22:28:18Z")

</div>

Are you using any plugins? Possibly something that is conflicting with Audio3D?

setOutput returns an FMOD.RESULT which may help if that call is failing.

---

<div class="post-metadata">

**Author:** ![oddraven](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@oddraven](https://qa.fmod.com/u/oddraven)\
**Post date:** [November 28, 2018, 7:50am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/5 "2018-11-28T07:50:36Z")

</div>

No, we are not using any plugins and anyway the error message comes from before those are loaded in the Unity integration (the error message says it is when calling initialize, which is the call to studioSystem.initialize - plugins are loaded right after that).  
The FMOD.RESULT is part of the provided error message (ERR\_PLUGIN)

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [November 29, 2018, 11:28pm UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/6 "2018-11-29T23:28:16Z")

</div>

Can you please send the logs through to [support@fmod.com](mailto:support@fmod.com) and I will look into this further for you.

---

<div class="post-metadata">

**Author:** ![RickyKunn](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RickyKunn](https://qa.fmod.com/u/RickyKunn)\
**Post date:** [March 6, 2024, 7:40am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/7 "2024-03-06T07:40:35Z")

</div>

I have same problem as you with using Oculus Quest.  
Is there any solution for Oculus to change output driver?

---

<div class="post-metadata">

**Author:** ![oddraven](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@oddraven](https://qa.fmod.com/u/oddraven)\
**Post date:** [March 6, 2024, 11:41am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/8 "2024-03-06T11:41:57Z")

</div>

I don’t think Oculus Quest has different audio outputs, which is probably why getNumDrivers only reports one. What driver are you trying to play audio through?

---

<div class="post-metadata">

**Author:** ![RickyKunn](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RickyKunn](https://qa.fmod.com/u/RickyKunn)\
**Post date:** [March 7, 2024, 5:53am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/9 "2024-03-07T05:53:43Z")

</div>

Do you meen “What kind of output device do you wanna use”?  
I’m trying to use oculus’s standard speaker when connecting headphone through earphone jack.

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [March 8, 2024, 12:32am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/10 "2024-03-08T00:32:04Z")

</div>

You can iterate through the output devices to determine which is the correct device to use, see [Oculus Setup](https://fmod.com/docs/2.02/unity/examples-oculus-setup.html) scripting example.

---

<div class="post-metadata">

**Author:** ![RickyKunn](https://avatars.discourse-cdn.com/v4/letter/r/ba8739/32.png) [@RickyKunn](https://qa.fmod.com/u/RickyKunn)\
**Post date:** [March 8, 2024, 2:47am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/11 "2024-03-08T02:47:12Z")

</div>

I thought it is the script for oculus rift. Is it possible to use for oculus quest?

---

<div class="post-metadata">

**Author:** ![cameron-fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/cameron-fmod/32/261_2.png) [@cameron-fmod](https://qa.fmod.com/u/cameron-fmod)\
**Post date:** [March 13, 2024, 2:05am UTC](https://qa.fmod.com/t/playing-audio-to-different-virtual-devices-on-ps4/14204/12 "2024-03-13T02:05:33Z")

</div>

I don’t believe that the `OVRManager.audioOutId` is Oculus Rift specific, the API used is generic for Oculus devices (even though the variable is named “riftId” in the script).
