Sign in to follow this  

XAudio2 lose volume control

This topic is 1123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my laptop I have a physical key that controls the master volume of windows 7

when I launch my app that uses XAudio2, the key no longer works

anyone knows how to fix this?

 

I already know that XAudio2 API has functions that can control its volume but I still want the volume keys to work

Share this post


Link to post
Share on other sites

Saying the key no longer works could mean several things.

 

With a bit of searching I don't see anyone online that has described a case where the API actually disabled the system functionality.

 

 

My first guess that the physical keys are triggering the VK_VOLUME_UP and VK_VOLUME_DOWN commands. When your app is up you get the first opportunity to handle the events  Are you consuming the events in your app? Or are you passing them along to the system handlers?

 

My next guess is that the volume buttons might be passed along, but perhaps your system is forcing the volume levels back to the old levels frequently. I've seen cases where games inadvertently emit commands to the system ever frame, and perhaps that is what is going on here. Maybe you are setting the system volume level somewhere, so even though the user bumps the volume up your app is immediately resetting the volume.

Share this post


Link to post
Share on other sites

I am using RAWINPUTDEVICE to get input form keyboard and mouse

I get the messages using

if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
	TranslateMessage(&msg);

	if (WM_INPUT == msg.message && RIM_INPUT == msg.wParam)
	{
	   //pressed keys or mouse
	}			
	DispatchMessage(&msg);
}

and one of thosekeys is called VK_VOLUME_UP

what do I have to do with that key when I get it?

 

Are you consuming the events in your app? Or are you passing them along to the system handlers?

I don't know

Edited by lomateron

Share this post


Link to post
Share on other sites

This topic is 1123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this