Hey, had a question about your XAudio implementation. How easy would it be to add functionality for panning and fading? Playing short sounds or looping is fine, but what if I want to fade a sound before stopping it or fade out one sound and fade in another like a transition? The panning would be more to simulate positional audio PlayLeft( value ) or PlayRight( value ) or even Play( left_percent, 1.f - left_precent ) something like that.
From what I can tell, the implementation just pushes back sound channels and when you stop a sound, it only stops the last added sound unless you Sound::StopAll. Would I need to search the vector of channels to find a sound to see if it's already started playing? That way I wouldn't be restarting the same sound each frame or should the sounds be part of an event that gets removed from a list once executed?
Hey chili, Sound API question
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Hey chili, Sound API question
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Hey chili, Sound API question
It's been a few years since I designed that... I believe the basic idea is that specific instantiations of a sound on channels are not individually trackable at the point of interface with the library. I don't see why you can't add that stuff if you want to. Maybe play returns a smart handle object that can be used to manipulate specific instances of a sound.
Chili