   [SlimDX] WaveStream.Read problem
  I have a WaveStream containing 24bit PCM stereo data at 44.1kHz.What I want to do is copy a part of that stream to a buffer, starting at position 44.The line looks something like this (C#):waveStream.Read(buffer, 44, (int)waveStream.Length-44);However, the buffer is always filled starting from position 42...? Am I doing something wrong or is it a bug?I looked at WaveStream.Read's source code but C++ to me is only special characters with a few capital letters in between.   
  WaveStream is a *stream*, which means you can't just read bytes from it at random. You can only read from where the current stream pointer is set. The offset parameter isn't an offset into the stream, but into the buffer parameter you're providing.In order to get to a specific location, use the Stream.Seek or Stream.Position properties to position it correctly and then do the read for however many bytes you want.   ;  Thanks for the reply.I'm aware how Stream.Read works and I'm setting the stream position before I start reading the stream.I had no problem with 16bit audio files, but testing it now there seems to be a problem as well which I just didn't realize earlier because 44 is a multiple of the 16bit/stereo block alignment.Anyway, using a 16bit file now it seems that the offset parameter in WaveStream.Read(buffer, offset, length) is ignored all together.(I probably had 7 empty samples at the beginning of my 24bit stream so it seemed like the buffer was filled from position 42 when it was really filled from position 0 as well)Edit: replaced code with simple exampleThis fails:WaveStream stream = new WaveStream(@"d:\01-AudioTrack 012.wav");byte[] buffer = new byte[1000];stream.Position = 0;stream.Read(buffer, 44, 956);for (int i = 0; i < 44; i++) {Debug.Assert(buffer == 0);}[Edited by - itachi on May 7, 2010 10:18:35 AM];  Yeah, it looks like the method doesn't take the offset parameter into consideration. This will be fixed for our next release.   