Added .mp3 export (#92)
* Update to larger bitrate * Add support for sub-voice export --------- Co-authored-by: katboi01 <59540382+katboi01@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
|
||||
namespace NAudio.Wave.WZT
|
||||
{
|
||||
/// <summary>
|
||||
/// This class used for marshalling from unmanaged code
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
||||
public class WaveFormatExtraData : WaveFormat
|
||||
{
|
||||
// try with 100 bytes for now, increase if necessary
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
|
||||
private byte[] extraData = new byte[100];
|
||||
|
||||
/// <summary>
|
||||
/// Allows the extra data to be read
|
||||
/// </summary>
|
||||
public byte[] ExtraData { get { return extraData; } }
|
||||
|
||||
/// <summary>
|
||||
/// parameterless constructor for marshalling
|
||||
/// </summary>
|
||||
internal WaveFormatExtraData()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads this structure from a BinaryReader
|
||||
/// </summary>
|
||||
public WaveFormatExtraData(BinaryReader reader)
|
||||
: base(reader)
|
||||
{
|
||||
ReadExtraData(reader);
|
||||
}
|
||||
|
||||
internal void ReadExtraData(BinaryReader reader)
|
||||
{
|
||||
if (this.extraSize > 0)
|
||||
{
|
||||
reader.Read(extraData, 0, extraSize);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes this structure to a BinaryWriter
|
||||
/// </summary>
|
||||
public override void Serialize(BinaryWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
if (extraSize > 0)
|
||||
{
|
||||
writer.Write(extraData, 0, extraSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user