Sound/Channel 3D panning Problem

Hey Guys,

i currently working on a unity game project with integrated VoIP. I’ve allready managed to play the VoIP PCM stream ingame with FMOD and stick the channel which plays the sound to a gameobject. Now my problem is that the sound/channel is panned differently then other events in the scene. When the gameobjects Y and Z position is the same as the listeners one and only differs on the X axis i can only hear the the only on the left or right ear, depending if the gameobject is left or right of the listener. Some exmples:

Listeners position | Gameobjects position | result
(0, 0, 0) | (0, 0, 0) | sound on both ears with same volume
(0, 0, 0) | (-1, 0, 0) | sound only on left ear
(0, 0, 0) | (1, 0, 0) | sound only on right ear
(0, 0, 0) | (-1, 0.33, 0) | sound on left ear and very quietly on the right
(0, 0, 0) | (1, 0.33, 0) | sound on rightear and very quietly on the left
(0, 0, 0) | (-1, 0, 0.33) | sound on left ear and very quietly on the right
(0, 0, 0) | (1, 0, 0.33) | sound on rightear and very quietly on the left

That the way i created the sound:

_fmod = RuntimeManager.LowlevelSystem;

_pcmReadCallback = new SOUND_PCMREADCALLBACK(PCMReadCallback);


exinfo.cbsize = Marshal.SizeOf(exinfo);
exinfo.decodebuffersize = 8192;
exinfo.length = 8192;
exinfo.numchannels = 1;
exinfo.defaultfrequency = 44100;
exinfo.format = SOUND_FORMAT.PCM16;
exinfo.pcmreadcallback = _pcmReadCallback;

_fmod.createSound(string.Empty, MODE._3D | MODE.OPENUSER | MODE.LOOP_NORMAL | MODE.CREATESTREAM, ref exinfo, out _sound);

_fmod.getMasterChannelGroup(out ChannelGroup channelGroup);

_fmod.playSound(_sound, channelGroup, false, out _channel);

_channel.set3DMinMaxDistance(MinAttenuation, MaxAttenuation);

Is there any 3D setting which controlls how a sound/channel is panned that i missed? My goal is it that the VoIP is as nealy panned as any other sound ingame.

Thanks and greetings

It would probably be a lot easier to use a 3D event with a programmer instrument to control the panning like this. You can then manipulate the FMOD Spatializer settings in the UI (eg. get panning without spatializing, adjust the min/max distance, etc.) rather than making adjustments in code like this. You should be able to reuse some of your existing code to pipe the VoIP audio into the programmer instrument.

Thanks for this hint. I’ll try it.

It works now.

I oriented on this example. In FMOD Studio i created an event with a spatializer on the master bus and one audio track and a loop region around it. In this audio track i created a programmer instrument and set it to trigger asynchronously and looping (do not confuse with loop region).

Thanks @richard_simms