Hello everybody. I am currently working on a project for school to demonstrate 3D sound and I’m having trouble incorporating movement for my sounds. I know that calling set3Dattributes will set the position/velocity for the sound but I am unsure if just calling update for the FMOD::System object will automatically adjust this based on the velocity it was given or do I need to call set3Dattributes() every time I update fmod as well. I have 3D sound working fine if the object stays still so I’m not really sure if I’m doing something wrong or if I’m just missing a step. Any help would be appreciates thanks!! 😀

Also the worldscale is handled internally so it isn’t needed in the velocity calculation. It’s also worth noting that the primary danger with auto-calculating the velocity is that if something teleports, there will be an audio glitch caused by the extremely large velocity. It’s good practice to sanity check the magnitude of the velocity before passing it into FMOD.

yeah, you guys may be right. I wrote this a while ago. I’m not sure if the vector is right… It sounds right or close enough possibly. I never notice the sounds not doppler properly, except yes, if you make a huge jump. Not sure if it’s worth taking a second go at it though… your thoughts?

Sorry for hijacking this thread, but my question is somehow related to this problem and i thought it’s better not to spawn another one.
So here is the problem.
In our project we have a cannon that shoots a roundball. What we want is this roundball to produce some sort of a flying sound. So when it passes the camera, it could be heard.
Seting positions and velocities with orientations is not a problem. What i realy don’t understand is should i call event->start() every frame for my "fly sound" or just once? I update position and velocity every frame. But if i call event-start() only once, they don’t get updated. So i’m calling it every frame, but i’m not sure if this is the right way to do it.
And yes. I do call eventSystem->Update() every frame with correct parameters for set3DListenerAttributes().

Since you question relates to the EventSystem it’s probably more suited to the FMOD Designer section of the forum, but I can see why you chose to post it here.

[quote:233qjin2]And yes. I do call eventSystem->Update() every frame with correct parameters for set3DListenerAttributes().[/quote:233qjin2]
Damn, that was the first thing i was going to ask.

You should [i:233qjin2]not[/i:233qjin2] be calling event start every frame. Is it possible that the event is getting stolen by another instance and calling start() every frame is masking the problem? Try increasing the ‘Max playbacks’ property for the event.

If i understand it correctly, then events can be stolen only if the same event is requested and not the other. Right? For example if i have max. playbacks for "wind" sound event set to 10 and requested all of them, and then request "shoot" sound event, this won’t steal one of "wind" events. Correct? I’m asking because i’m not completely sure about this. But max. playbacks was already set to 200 (just for testing).
I’ll try to clarify one thing. The "fly" event IS playing but it’s positions are not altered. So it plays at it’s first set position.

[quote="RS543":fv1w3bqf]Hello everybody. I am currently working on a project for school to demonstrate 3D sound and I’m having trouble incorporating movement for my sounds. I know that calling set3Dattributes will set the position/velocity for the sound but I am unsure if just calling update for the FMOD::System object will automatically adjust this based on the velocity it was given or do I need to call set3Dattributes() every time I update fmod as well. I have 3D sound working fine if the object stays still so I’m not really sure if I’m doing something wrong or if I’m just missing a step. Any help would be appreciates thanks!! :D[/quote:fv1w3bqf]

it’s a little tricky. Here is the set of functions that handle listener movement and channel movement in my wrapper dll

So, when your games starts, you set the scale and the fps.
You set listener position and set channel (instance in my wrapper) position every step
You call System update and the sounds should now play according to position and velocity.

deltatime 0 means no doppler effect
watch my reference to the listener id (I use a 1-4 value)
My wrapper is for a game engine that only allows doubles for external function, so ignore that…
And I used the c api, you should not have any trouble grabing what you need and converting it the c++ if you need.
Hope this helps

That’s the most common way for stealing to occur, but there are others as well. There is also channel stealing based on priority/audibility in that order so it could be related to that.

[quote:1zkojf38]The "fly" event IS playing but it’s positions are not altered. So it plays at it’s first set position.[/quote:1zkojf38]
If the event is audible but just not getting positioned correctly then the problem isn’t stealing. Can you confirm that set3DAttributes is returning FMOD_OK? It sounds like you have an invalid handle.

Thanks I really appreciate the help. I implemented all that stuff and it works fine but then I found my problem I think. Everytime I call get3Dattributes() on my channel the position is always set to 0. I double checked to make sure I wasn’t calling set3Dattributes() somewhere else and I’m not so I’m clueless as to why its always 0. Any ideas? 😮

Oopss…. 😳
Terribly sorry for missleading info. Apparently our sound designer already corrected this issue in FMOD Designer. Don’t know what he changed, but i wasn’t informed of this. Seems that sound was to short to hear that position is updated. Perhaps he just looped the sound and it worked like a charm!
Thank you for helping! And sorry again… 😳

It sounds like you don’t have a valid channel handle, are you checking the FMOD_RESULT that is being returned?

[quote:2j0hkao3]do I need to call set3Dattributes() every time I update fmod[/quote:2j0hkao3]
Yes, you need to update the position of 3D channels every frame. The velocity value is used for the doppler effect and is not needed for 3D positioning.