March 24, 2016 at 5:48 am #2152
I’m trying to create a multiplayer (2 players) game, in which every player has a pair of headphones.
Each player should hear the sound like received at their position/transform.
Could that maybe be done using two RealSpace3D AudioListener objects, which each generate sound from different positions for each player?
One listener could then output audio to the (default) front left/right speaker port, and the other one to one of the surround output ports, like rear left/right speakers (both these ports would have a stereo headset/headphones connected).
This would be an awesome addition to the RealSpace3D plugin.
March 24, 2016 at 12:48 pm #2155
The RS3D AudioListener does no processing, it is only used for selecting HRTFs (Head Related Transfer Function) data set and head, neck, torso params. Unity’s AudioListener is still processing and must be in the scene. Unity doesn’t allow for multiple AudioListeners in a scene (2+ AudioListeners will be ignored and you will receive warning messages in the console window). However, in your application you can write a script (I haven’t tried this but should work…when I get some free cycles (hmmmnnn…when will that be 😉 ) I will give it a try) that checks if the network view is yours…
(Sorry about formatting)
private Camera theCamera;
theCamera = Camera.main;
theCamera.active = true;
theCamera.GetComponent(AudioListener).enabled = true;
GetComponent(MouseLook).enabled = false;
theCamera.active = false;
theCamera.GetComponent(AudioListener).enabled = false;
Something like that should work.
You must be logged in to reply to this topic.