Getting WaveFormat for stream underlying WaveChannel32

Jul 20, 2011 at 8:11 AM

Hi,

If I create a WaveChannel32 instance like:

 

WaveChannel32 wavref = new WaveChannel32(new WaveFileReader("myfile.wav"));

 

is there any way I can get the WaveFormat for the underlying stream (the WaveFileReader)?

If not this seems to be a bit of a shortcoming.  WaveChannel32 has a WaveFormat but this is hard coded in the constructor to stereo 32 bit.  I need to make some decisions on the format of the underlying (input) wav file format.

I guess I will have to break out the statement into a few lines and keep a reference to the underlying stream myslf - is this correct?

Thanks,

Ian

Coordinator
Jul 26, 2011 at 9:25 AM

yes, that would be good a way to do it