mirror of
https://github.com/claunia/cuetools.net.git
synced 2025-12-16 18:14:25 +00:00
2.0.7
This commit is contained in:
41
CUETools.Codecs.CoreAudio/WaveFormats/WaveFormatExtraData.cs
Normal file
41
CUETools.Codecs.CoreAudio/WaveFormats/WaveFormatExtraData.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
|
||||
namespace NAudio.Wave
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
||||
class WaveFormatExtraData : WaveFormat
|
||||
{
|
||||
// try with 100 bytes for now, increase if necessary
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
|
||||
byte[] extraData = new byte[100];
|
||||
|
||||
/// <summary>
|
||||
/// parameterless constructor for marshalling
|
||||
/// </summary>
|
||||
WaveFormatExtraData()
|
||||
{
|
||||
}
|
||||
|
||||
public WaveFormatExtraData(BinaryReader reader)
|
||||
: base(reader)
|
||||
{
|
||||
if (this.extraSize > 0)
|
||||
{
|
||||
reader.Read(extraData,0, extraSize);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(BinaryWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
if (extraSize > 0)
|
||||
{
|
||||
writer.Write(extraData, 0, extraSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user