In my app i use Midi-dot-net to get NoteON messages and NAudio to play audio samples / notes. In NAudio i'm using ASIO implementation for lower latency and it works perfectly. But i have a problem with controlling volume. Before i used ASIO engine i was able to controll volume this way (some part of the code):
private void...()
{
int NewVolume = ((ushort.MaxValue / 50) * trackWave.Value);
uint NewVolumeAllChannels = (((uint)NewVolume & 0x0000ffff) | ((uint)NewVolume << 16));
waveOutSetVolume(IntPtr.Zero, NewVolumeAllChannels);
volumeN.Text = trackWave.Value.ToString();
}
When i'm using ASIO implementation in NAudio it's not working, i can only mute sounds, but can't change its volume.
Do you know how can i controll volume by the use of volume slider placed in external Midi controller? Somehow it works when i was testing Steinberg or Synthogy or other audio software producers with ASIO drivers.
Thank you for any help.