protected PcmData(int bits, byte[] pcmData, bool isDataInLittleEndianFormat) { bytes = (byte)(bits / 8); if (pcmData.Length % bytes != 0) { throw new Exception("Invalid PCM format. The PCM data was an invalid size."); } data = pcmData; length = data.Length / bytes; if (BitConverter.IsLittleEndian != isDataInLittleEndianFormat) { WaveHelper.SwapEndianess(data, bits); } }