I have a slider and a webbrowser object in my form and sliding it should change the volume, however it does move the slider as seen here: 
but it doesn’t change the volume’s actual output. This is probably because I integrated the WebBrowser object and using Windows 7. When I manually slide the slider (the one seen in the screenshot) the volume output does change. When playing a .wav file the volume’s output does change, but not with the WebBrowser object.
I’m using the following code:
Xaml
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Slider Minimum="0" Maximum="10" ValueChanged="ValueChanged"/>
</Grid>
</Window>
C#
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
}
private void ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
// Calculate the volume that's being set
double newVolume = ushort.MaxValue * e.NewValue / 10.0;
uint v = ((uint) newVolume) & 0xffff;
uint vAll = v | (v << 16);
// Set the volume
int retVal = NativeMethods.WaveOutSetVolume(IntPtr.Zero, vAll);
Debug.WriteLine(retVal);
}
}
static class NativeMethods
{
[DllImport("winmm.dll", EntryPoint = "waveOutSetVolume")]
public static extern int WaveOutSetVolume(IntPtr hwo, uint dwVolume);
}
Try using a MediaElement.
Then you could play your radio station like this:
And change the volume with
Both the Windows Mixer and the WPF slider now change the volume appropriately, but the values of the two are independent and don’t reflect each other’s’ changes.