Get current volume of XAudio2

This forum is currently in read-only mode.
From the Asset Store
10 different explosions rendered as transparent PNG.
  • I was messing around with XAudio2 and the 360 controller, trying to scale the controller's rumble to the volume of a positioned sound, when I realised there's no way to get the current volume of a channel with the XAudio2 object. I guess there's only limited uses for it, but it would be useful if you could test the current volume of a sound. That way, you could change the visuals on-screen according to your proximity to a sound, might be a cool effect for 'atmosphere' games. I was just going for 'the closer you are to an explosion, the more rumbling the controller does.'

    • Tom
  • If that's all you want to do, why not just come up with your own rumbling-factor based on distance(player.x, player.y, source.x, source.y)? While there should be a get channel volume expression, surely you don't want the inverse-square relationship of sound for controller rumbling?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yeah, I've done the rumbly thing myself now, using that method, and it works nicely. It was just that comparing it to the volume was the first thing that came to mind, which brought to my attention the lack of a 'get volume' expression. Granted, it's pretty redundant in the example I gave, but it'd still be a nice feature, and I'm sure someone could find a use for it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)