Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [DllImport("winmm.dll")]
- private static extern int waveOutSetVolume(IntPtr hwo, uint dwVolume);
- private void SetVolume(int volume)
- {
- int NewVolume = ((ushort.MaxValue / 10) * volume);
- uint NewVolumeAllChannels = ((Convert.ToUInt32(NewVolume) & 0xffff) | (Convert.ToUInt32(NewVolume) << 16));
- waveOutSetVolume(IntPtr.Zero, NewVolumeAllChannels);
- }
Add Comment
Please, Sign In to add comment