OpenNETCF.Media.WaveAudio.Wave Class

We have received a few customer request to use the Wave.SetVolume and Wave.GetVolume methods in the OpenNETCF.Media.WaveAudio.Wave class.  Unfortunately, there is no default constructor for the Wave class so you cannot directly call these methods.

Using a little bit of Reflection we can get the private contructor of the Wave class using Type.GetConstructors().

Here is some sample code to call Wave.SetVolume and Wave.GetVolume.  (NOTE:  this is currently not supported and may not work in future releases of the Smart Device Framework)

OpenNETCF.Media.WaveAudio.Wave wave = null;

ConstructorInfo[] ci = typeof(OpenNETCF.Media.WaveAudio.Wave).GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);

if (ci.Length == 1)

wave = (OpenNETCF.Media.WaveAudio.Wave)ci[0].Invoke(null);

if (wave != null)


Warning: count(): Parameter must be an array or an object that implements Countable in /home/usnbis1maldq/domains/ on line 405

Leave a Reply