How to control the volume of the CE devic in CSharp

  • Thread starter Thread starter compboy
  • Start date Start date
Thanks, Peter.
I had tried the first method,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class CoreLibVol
{
[DllImport("Coredll.dll")]
public static extern bool sndPlaySound(string lpszSoundName, uint
fuSound);

[DllImport("Coredll.dll")]
public static extern uint waveOutSetVolume(uint hwo, ulong dwVolume);
...
}

public class SetVolumeCls
{
...
public void GetWaveFormAudio()
{
uint DeviceID;
uint pVolume;

CoreLibVol.waveOutGetVolume(DeviceID, out pVolume);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
how can i get the DeviceID in my program?
 
Read the source for the OpenNETCF class?

Paul T.

compboy said:
Thanks, Peter.
I had tried the first method,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class CoreLibVol
{
[DllImport("Coredll.dll")]
public static extern bool sndPlaySound(string lpszSoundName, uint
fuSound);

[DllImport("Coredll.dll")]
public static extern uint waveOutSetVolume(uint hwo, ulong dwVolume);
...
}

public class SetVolumeCls
{
...
public void GetWaveFormAudio()
{
uint DeviceID;
uint pVolume;

CoreLibVol.waveOutGetVolume(DeviceID, out pVolume);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
how can i get the DeviceID in my program?



Peter Foot said:
You can either P/Invoke the waveOutSetVolume API method, or use the
ready-made OpenNETCF.Multimedia.Audio.Player class and it's Volume property
(www.opennetcf.org/sdf/)

Peter
 
Back
Top