# Can't get FMOD\_Channel\_Set3DSpread to work

**URL:** <https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952>\
**Category:** FMOD Engine\
**Created:** [March 8, 2023, 8:11pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952 "2023-03-08T20:11:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [March 8, 2023, 8:11pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/1 "2023-03-08T20:11:37Z")

</div>

Edit: I got it to work, but it seems like the sound only becomes spread out once the listener isn’t standing right on top of it. Is there any way to retain the stereo image even when the sound is right in the center?  
Greetings,

I am trying to implement FMOD into my game, and I ran into an issue with playing stereo 3d sounds.  
The documentation says that playing stereo sounds results in the separate channels being played as two separate voices, and that the width can be adjusted with FMOD\_Channel\_Set3DSpread.  
What I’ve tried: Creating a new sample with a stereo file, playing it with paused set to true, calling FMOD\_Channel\_Set3DSpread(channel, 360), but the sound still gets collapsed to a mono mix of left+right instead of being spaced out.  
I have tried different angle values, none of them sound much different.  
Am I supposed to somehow retrieve the sub-voices and spread them out individually?  
I’m using the core API from C.

Thank you for any help.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 10, 2023, 3:14am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/2 "2023-03-10T03:14:16Z")

</div>

Hi,

What version of FMOD are you using? Would it be possible to get a code snippet uploaded to look over?

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [March 14, 2023, 5:43pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/3 "2023-03-14T17:43:12Z")

</div>

Thank you for responding, and my apologies for the delayed reply.  
My header file says:  
#define FMOD\_VERSION 0x00020212 /\* 0xaaaabbcc → aaaa = product version, bb = major version, cc = minor version.\*/  
I’m just calling FMOD\_System\_Create with the version constant, FMOD\_System\_Init with FMOD\_INIT\_NORMAL, FMOD\_System\_CreateSound with the UTF8 string containing the path to the sound, and FMOD\_CREATESAMPLE|FMOD\_3D|FMOD\_LOOP\_NORMAL as the mode, and then calling FMOD\_System\_PlaySound with paused set to true, and then to make the stereo file wide, I call FMOD\_Channel\_Set3DSpread with 150 degrees (I’ve tried different values, anything above 150 doesn’t sound right to me). I also call FMOD\_System\_Set3DListenerAttributes and FMOD\_System\_Update every frame.  
The problem I have is that when the listener z is equal to sound z, the sound collapses to mono (as if my 3d spread was set to default/0) when I would prefer it to sound the same (spread out) as if listener z was less than sound’s z.  
Another problem is that when listener z is grater than sound’s z, the sound image rotates so that left channel becomes the right one and vice versa, which confuses me because listener is still facing forward.  
I hope that makes sense/I’d appreciate any pointers on how to get the behavior I desire.  
Sometimes I have a river sound for example that would sound bad being collapsed to mono if the listener is standing inside the river. I can understand it being collapsed to mono if the listener is standing to the left or right of the source, but I’d expect it to slowly start widening as I approach the sound source’s middle, and then slowly start narrowing as I start going toward its left edge, which is the behavior I get if the listener is +z or -z, with the issue that +z reverses the sound channels.  
I hope I have understood things correctly: by default (left-handed coordinate system) means that +x=right, -x=left, +y=above, -y=below, +z=in front, -z=behind?  
In the engine I have been using so far, y was in front/behind, and z was above/below, so I hope I have understood that correctly.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [March 20, 2023, 11:30pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/4 "2023-03-20T23:30:12Z")

</div>

Hi,

Thank you for the explanation. I was not able to reproduce the issue in our core examples. Would it be possible to get a stripped-out project where you are experiencing this?

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [April 22, 2023, 2:41pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/5 "2023-04-22T14:41:08Z")

</div>

Hi, happy belated Easter if you celebrate.  
It took me a while to make a demo, but here it is. There’s a test.wav file in the zip which has a sine wave hard-panned to the right, and brown noise hard-panned to the left.  
The code cycles the listener z between -1, 0, and 1, and back to -1 every 1 second. -1 (at least here) sounds stereo, if a bit narrower than the original, 0 sounds completely mono, and 1 sounds stereo as well, but now the sine is on the left, and brown noise is on the right.  
I have compiled fmod.exe with gcc, there’s a make.bat included.  
I could just be doing something wrong, but the reason I wish for sounds not to lose their proper image is because in my games and many other audio games, there are stereo ambiences like a static river loop, or crowd that still need to position themselves (so 2d wouldn’t work), but I wouldn’t like for them to be channel-flipped or downmixed to mono.  
I could of course be doing something silly…  
I don’t see an upload file option, so here’s a link: [https://nsstudiosweb.com/downloads/fmodDemo.zip](https://nsstudiosweb.com/downloads/fmodDemo.zip)  
Thank you.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [April 26, 2023, 2:49am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/6 "2023-04-26T02:49:02Z")

</div>

Hi, happy easter!

Thank you very much for the demo, it was very useful.

What I am experiencing is instead of your listener moving on the `z-axis` rather it is rotating around the `y-axis` which is why the sound is rotating around the listener. Can I confirm that you are wanting to have the sound’s stay on their respective sides while the listener moves back and forth?

Included with the `FMOD Engine` download there are some API examples, specifically a `3D` example which I think might display the behavior you are looking for. It should be found under `"X:\Program Files (x86)\FMOD SoundSystem\FMOD Studio API Windows\api\core\examples\3d.cpp"`, there may be some information included in the example that may solve the issue.

Again, thank you for the demo and I hope this helps!

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [April 26, 2023, 4:43am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/7 "2023-04-26T04:43:18Z")

</div>

Thank you for the response, I appreciate it a lot.  
I did take a look at the 3d.cpp example, but I see changing of the x axis only. My games are usually 3d in the sense that x=walking left/right, z=walking forward/backward, and y=climbing up/down or jumping all without changing the direction that the listener is facing.  
The only field in the position vector that I’m changing is z, and to my understanding z represents +z=in front, -z=behind, while +x=right, -x=left, +y=above, -y=below; is that incorrect?  
When I change pos.z, I expect it to be absolute coordinate change without any rotation/facing change, so my expectation is the listener just moves from 0,0,-1 to 0,0,0, to 0,0,1, and jumps back to 0,0,-1 with facing forward the whole time.  
Hopefully that makes sense.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [April 27, 2023, 1:33am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/8 "2023-04-27T01:33:09Z")

</div>

Hi,

Could you enable `Live Update` in your engine using the `FMOD_STUDIO_INIT_LIVEUPDATE` init flag ([FMOD API | Studio API System - Initialize](https://fmod.com/docs/2.02/api/studio-api-system.html#studio_system_initialize)) and connect the [FMOD Studio - Profiler](https://fmod.com/docs/2.02/studio/profiling.html) and keep an eye on the 3D View ([Profiler - Overview](https://fmod.com/docs/2.02/studio/profiling.html?search=3d%20overview#3d-view))  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/764f8f9a553a5ae7224a1a179e36c8f7964cb379.png)  
Which will show the current position of the emitter in relation to the listener. What we would expect to see is the emitter moving back and forth. Hopefully, this will shed some light on the movement you are experiencing.

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [April 27, 2023, 10:43am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/9 "2023-04-27T10:43:07Z")

</div>

Greetings,

Thank you for the answer.  
Unfortunately if the profiler is graphical in nature, I wouldn’t be able to use it.  
Can you confirm that by default in core API +x represents right, +y up, and +z in front?  
The documentation seems unclear when it comes to that:  
Note for plugin writers: FMOD always uses a left-handed coordinate system when passing 3D data to plugins. This coordinate system is fixed to use +X = right, +Y = up, +Z = forward. When the system is initialised to use right-handed coordinates FMOD will flip the Z component of vectors before passing them to plugins.  
VS  
By default FMOD uses a left-handed coordinate system. The positive Y axis points up, the positive X axis points to the right, and the positive Z axis points away from the listener.  
I would just like to move left/right (x), up/down (y), and back and forth (z), no rotation or facing direction change involved.  
Are you trying to say that z rotates y?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [April 30, 2023, 11:21pm UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/10 "2023-04-30T23:21:08Z")

</div>

> [@nsstudios](#):
>
> Can you confirm that by default in core API +x represents right, +y up, and +z in front?

Correct.

> [@nsstudios](#):
>
> When I change pos.z, I expect it to be absolute coordinate change without any rotation/facing change, so my expectation is the listener just moves from 0,0,-1 to 0,0,0, to 0,0,1, and jumps back to 0,0,-1 with facing forward the whole time.

Would it be possible to get a code snippet of how you are getting the position of the listener and then moving it?

> [@nsstudios](#):
>
> Are you trying to say that z rotates y?

No, I was just describing what I was hearing. But that could also be explained if the listener was moving from side to side. If I could have a look at the code you are using to move the listener it may shed some light on what is happening.

If you would prefer you can [upload](https://fmod.com/profile#uploads) files to your [profile](https://fmod.com/profile#profile) after registering a [project](https://fmod.com/profile#projects) with us.

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [May 1, 2023, 4:12am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/11 "2023-05-01T04:12:12Z")

</div>

Thanks again for the response.  
As My earlier demo shows, I just have an FMOD\_VECTOR with x y z values that are incremented/decremented every time the user steps in a certain direction. An up arrow walks forward, the z is increased by 1. Down arrow does the backward walking, z is decreased by 1. Left/right arrows decrease/increase x by 1 respectively, and jumping or climbing increase/decrease y, then I just pass the vector to the FMOD\_System\_Set3DListenerAttributes in my main loop.  
I could make a quick example if that would help, but I’m still confused as to why would the sound flip if the listener hasn’t changed the facing direction. If I walk passed a pair of speakers, for example, even if they were behind me, the left one would still be to my left, the right would be on my right. they wouldn’t flip on me unless I had turned my head, or turned my whole body around 180 degrees. As far as I understand, the controls that control facing are the const FMOD\_VECTOR \*forward, const FMOD\_VECTOR \*up params instead.  
I can understand why the sound would go mono, but you said you couldn’t reproduce that, so I’m confused if that’s a feature or not.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [May 8, 2023, 5:40am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/12 "2023-05-08T05:40:48Z")

</div>

Hi,

Apologies for the delayed response. Using your project I was able to reproduce the issue. I will pass it to the development team to look into further, once there is more information I can share I will let you know.

Again thank you for the demo it was extremely helpful trying to find the issue.

---

<div class="post-metadata">

**Author:** ![nsstudios](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@nsstudios](https://qa.fmod.com/u/nsstudios)\
**Post date:** [May 8, 2023, 9:20am UTC](https://qa.fmod.com/t/cant-get-fmod-channel-set3dspread-to-work/19952/13 "2023-05-08T09:20:41Z")

</div>

No problem. Thank you for looking into it further. I’m probably just doing something wrong, but I look forward to getting the definitive answer/solution.
