public float GetSample(int channel, int position) { float sample; unsafe { void* ptr = ptrData.ToPointer(); int pos = position * Channels + channel; switch (format) { case SampleFormat.Format32BitIeeeFloat: sample = ((float*)ptr)[pos]; break; default: throw new NotSupportedException(); } } return sample; }