I am a little confused to when these should be called. Previously, I called [b:3r51nsr5]set3DListenerAttributes () [/b:3r51nsr5]on each frame, and update () every 32 ms. This gave me undesired artifacts and hissing volume effects.
Then noticed it said in the documentation that[b:3r51nsr5] update ()[/b:3r51nsr5] should be called every frame, so I moved it there. Less issues, but fast moving objects still hiss. Moved both calls to be updated on each frame and now it sounds perfect as long as I am not using headphones.
I guess for performance reasons I should revise putting [b:3r51nsr5]set3DListenerAttributes ()[/b:3r51nsr5] in there? I could not see any big differences in my profiler, but I did not play alot of sounds so it probably does not matter.
Will I get performance issues later?
Thanks for any assistance you can give me.
- Stefan Lundmark asked 10 years ago
If you update the 3d audio position information at a slower rate than the graphics framerate, you will get jerky sounding audio – if an object moves and the sound doesnt, it will sound wrong. Thats why you do it once per frame.
There is no performance issue here, as System::update is slow, it just does a few calculations and some channel management.
Saying there is hissing noise etc is something else entirely, that is not an effect of updating 3d positions.
[quote:37yfepcf]50 ms is per frame.[/quote:37yfepcf]
Huh? Are you assuming I am rendering at 20 fps? 😕
[quote="brett":37yfepcf]Saying there is hissing noise etc is something else entirely, that is not an effect of updating 3d positions.[/quote:37yfepcf]
Well, not sure it is called hissing. When I start the sound, it is hearable to me and crystal clear, then suddenly it disappears (when an update has happened, probably?). It is still playing and hearable if I turn the speakers up, but seems to be at the correct position unlike when it was started.
The strange thing is that it only happens with DSP’s[/b:37yfepcf] (does not seem to matter which one, I tried both normalize and lowpass) and if I deactivate them the sound is the same like in any professional game, ie good.
The reason I asked was because in the docs it said update () should be called each frame. Now, that is alot and in some of the examples I see 50 ms intervals rather than per frame.
Anyway, thanks for your assistance as always, Brett. You got a wonderful API there.
Please login first to submit.