public void WaveFormat_CreateIeeeFloat() { // Define "native" WAVEFORMATEX structure for IEEE float PCM byte[] formatBytes = new byte[] { 0x03, 0x00, // FormatTag = 3 0x02, 0x00, // Channels = 2 0x44, 0xac, 0x00, 0x00, // SamplesPerSec = 44100 0x20, 0x62, 0x05, 0x00, // AvgBytesPerSec = 352800 0x08, 0x00, // BlockAlign = 8 0x20, 0x00, // BitsPerSample = 32 0x00, 0x00, // ExtraSize = 0 }; // Create equivalent managed WaveFormat object WaveFormat format = WaveFormat.CreateIeeeFloat(44100, 2); // Verify against expected this.MarshalAndVerify(format, formatBytes); }
private void ButtonCreateIeeeFloat_Click(object sender, RoutedEventArgs e) { Update(WaveFormat.CreateIeeeFloat((int)Format.SamplesPerSec, Format.Channels)); }