Your code worked fine for me (with a few settings). Here is the code for a very simple WPF test application running on Windows 7 x64:
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>
FROM#
public partial class MainWindow { public MainWindow() { InitializeComponent(); } private void ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {
When I launch the application and move the slider, an additional volume control appears in the "Volume Mixer", which synchronously moves from the slider to max. using the slider.
You should examine the return value from waveOutSetVolume. This may give you a clue if your code is still not working.
Phil
source share