/// <summary> /// Generate a "Codec Private Data" string for an AAC stream (values approximate). /// </summary> private string GenerateAAC_Private() { MpegLayer3WaveFormat wfmt = new MpegLayer3WaveFormat(); wfmt.BitratePaddingMode = 0; wfmt.BlockSize = 312; wfmt.CodecDelay = 0; wfmt.FramesPerBlock = 1; wfmt.Id = 1; wfmt.WaveFormatExtensible = new WaveFormatExtensible(); wfmt.WaveFormatExtensible.AverageBytesPerSecond = 96000 / 8; wfmt.WaveFormatExtensible.BitsPerSample = 0; wfmt.WaveFormatExtensible.BlockAlign = 1; wfmt.WaveFormatExtensible.Channels = 1; wfmt.WaveFormatExtensible.FormatTag = 0xFF; wfmt.WaveFormatExtensible.SamplesPerSec = 44100; wfmt.WaveFormatExtensible.Size = 12; return(wfmt.ToHexString()); }
/// <summary> /// Generate a "Codec Private Data" string for an MP3 stream (values approximate). /// </summary> private string GenerateMP3_Private() { MpegLayer3WaveFormat wfmt = new MpegLayer3WaveFormat(); wfmt.BitratePaddingMode = 0; wfmt.BlockSize = 312; wfmt.CodecDelay = 0; wfmt.FramesPerBlock = 1; wfmt.Id = 1; wfmt.WaveFormatExtensible = new WaveFormatExtensible(); wfmt.WaveFormatExtensible.AverageBytesPerSecond = 96000 / 8; wfmt.WaveFormatExtensible.BitsPerSample = 0; wfmt.WaveFormatExtensible.BlockAlign = 1; wfmt.WaveFormatExtensible.Channels = 1; wfmt.WaveFormatExtensible.FormatTag = 85; wfmt.WaveFormatExtensible.SamplesPerSec = 44100; wfmt.WaveFormatExtensible.Size = 12; return wfmt.ToHexString(); }