Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, I'm working on a 2D game and I want to implement sound playback in a way, that the volume of the sound depends on the distance of the object that emits the sound. So setting a volume for a sound effect is no actual option for me, as multiple instances of the sound could be played all with different volumes. I'm not looking for 3D playback as well, as this makes it way more complicated than it actually is. Is there no way to play a sound with a specific volume? I know that I can create a pointer to an ISound object for every sound that I play, however then I would have to check every frame if the sound is still playing (not that this is a big issue but I want to be as efficient as possible). So what is the best way of doing this? I hope you guys can help me out. ;) Thanks, S. P. Gardebiter |
||||
|
I think the simplest way is to simply use play3D, and just ignore the z coordinate. Simply set you 2D coordinates into x and y, and set z to 0, always. For setting the volume of a specific sound, you need to use the ISound interface.Checking if it is still playing isn't complicated either, just use isFinished(). :) |
|