The story: I\'m writing a music player controlled by voice. Previously the project used winamp for music -- which I\'d like to do away with. I\'d like to integrate the voice
I have tested this in Windows Media Player VER 12, so I guess for most people there is a much easier way than using "user32.dll":
private static WMPLib.WindowsMediaPlayer Player;
public static void VolumeUp()
{
if (Player.settings.volume < 90)
{
Player.settings.volume = (Player.settings.volume + 10);
}
}
public static void VolumeDown()
{
if (Player.settings.volume > 1)
{
Player.settings.volume = (Player.settings.volume - (Player.settings.volume / 2));
}
}
No doubt this has been supported for some time now. It does not change the Master Volume and only the Media Player Volume is changed. The Windows Master Volume is left alone.
Hope this helps others out there that are not limited to XP SP3.