本文整理汇总了C#中NVorbis.VorbisStreamDecoder类的典型用法代码示例。如果您正苦于以下问题:C# VorbisStreamDecoder类的具体用法?C# VorbisStreamDecoder怎么用?C# VorbisStreamDecoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VorbisStreamDecoder类属于NVorbis命名空间,在下文中一共展示了VorbisStreamDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
internal static VorbisMode Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
var mode = new VorbisMode(vorbis);
mode.BlockFlag = packet.ReadBit();
mode.WindowType = (int)packet.ReadBits(16);
mode.TransformType = (int)packet.ReadBits(16);
var mapping = (int)packet.ReadBits(8);
if (mode.WindowType != 0 || mode.TransformType != 0 || mapping >= vorbis.Maps.Length) throw new InvalidDataException();
mode.Mapping = vorbis.Maps[mapping];
mode.BlockSize = mode.BlockFlag ? vorbis.Block1Size : vorbis.Block0Size;
// now pre-calc the window(s)...
if (mode.BlockFlag)
{
// long block
mode._windows = new float[4][];
mode._windows[0] = new float[vorbis.Block1Size];
mode._windows[1] = new float[vorbis.Block1Size];
mode._windows[2] = new float[vorbis.Block1Size];
mode._windows[3] = new float[vorbis.Block1Size];
}
else
{
// short block
mode._windows = new float[1][];
mode._windows[0] = new float[vorbis.Block0Size];
}
mode.CalcWindows();
return mode;
}
示例2: Init
internal static VorbisCodebook Init(VorbisStreamDecoder vorbis, DataPacket packet, int number)
{
var temp = new VorbisCodebook();
temp.BookNum = number;
temp.Init(packet);
return temp;
}
示例3: Init
internal static VorbisCodebook Init(VorbisStreamDecoder vorbis, DataPacket packet, int number)
{
VorbisCodebook vorbisCodebook = new VorbisCodebook();
vorbisCodebook.BookNum = number;
vorbisCodebook.Init(packet);
return vorbisCodebook;
}
示例4: Init
internal static VorbisMode Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
VorbisMode vorbisMode = new VorbisMode(vorbis);
vorbisMode.BlockFlag = packet.ReadBit();
vorbisMode.WindowType = (int) packet.ReadBits(16);
vorbisMode.TransformType = (int) packet.ReadBits(16);
int index = (int) packet.ReadBits(8);
if (vorbisMode.WindowType != 0 || vorbisMode.TransformType != 0 || index >= vorbis.Maps.Length)
throw new InvalidDataException();
vorbisMode.Mapping = vorbis.Maps[index];
vorbisMode.BlockSize = vorbisMode.BlockFlag ? vorbis.Block1Size : vorbis.Block0Size;
if (vorbisMode.BlockFlag)
{
vorbisMode._windows = new float[4][];
vorbisMode._windows[0] = new float[vorbis.Block1Size];
vorbisMode._windows[1] = new float[vorbis.Block1Size];
vorbisMode._windows[2] = new float[vorbis.Block1Size];
vorbisMode._windows[3] = new float[vorbis.Block1Size];
}
else
{
vorbisMode._windows = new float[1][];
vorbisMode._windows[0] = new float[vorbis.Block0Size];
}
vorbisMode.CalcWindows();
return vorbisMode;
}
示例5: VorbisResidue
protected VorbisResidue(VorbisStreamDecoder vorbis)
{
_vorbis = vorbis;
_residue = new float[_vorbis._channels][];
for (int i = 0; i < _vorbis._channels; i++)
{
_residue[i] = new float[_vorbis.Block1Size];
}
}
示例6: Init
internal static VorbisTime Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
int num = (int) packet.ReadBits(16);
VorbisTime vorbisTime = (VorbisTime) null;
if (num == 0)
vorbisTime = (VorbisTime) new VorbisTime.Time0(vorbis);
if (vorbisTime == null)
throw new InvalidDataException();
vorbisTime.Init(packet);
return vorbisTime;
}
示例7: Init
internal static VorbisMapping Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
int num = (int) packet.ReadBits(16);
VorbisMapping vorbisMapping = (VorbisMapping) null;
if (num == 0)
vorbisMapping = (VorbisMapping) new VorbisMapping.Mapping0(vorbis);
if (vorbisMapping == null)
throw new InvalidDataException();
vorbisMapping.Init(packet);
return vorbisMapping;
}
示例8: Init
internal static VorbisMapping Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
var type = (int)packet.ReadBits(16);
VorbisMapping mapping = null;
switch (type)
{
case 0: mapping = new Mapping0(vorbis); break;
}
if (mapping == null) throw new Exception();
mapping.Init(packet);
return mapping;
}
示例9: Init
internal static VorbisTime Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
var type = (int)packet.ReadBits(16);
VorbisTime time = null;
switch (type)
{
case 0: time = new Time0(vorbis); break;
}
if (time == null) throw new InvalidDataException();
time.Init(packet);
return time;
}
示例10: Init
internal static VorbisFloor Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
var type = (int)packet.ReadBits(16);
VorbisFloor floor = null;
switch (type)
{
case 0: floor = new Floor0(vorbis); break;
case 1: floor = new Floor1(vorbis); break;
}
if (floor == null) throw new InvalidDataException();
floor.Init(packet);
return floor;
}
示例11: Init
internal static VorbisResidue Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
var type = (int)packet.ReadBits(16);
VorbisResidue residue = null;
switch (type)
{
case 0: residue = new Residue0(vorbis); break;
case 1: residue = new Residue1(vorbis); break;
case 2: residue = new Residue2(vorbis); break;
}
if (residue == null) throw new InvalidDataException();
residue.Init(packet);
return residue;
}
示例12: Init
internal static VorbisFloor Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
int num = (int) packet.ReadBits(16);
VorbisFloor vorbisFloor = (VorbisFloor) null;
switch (num)
{
case 0:
vorbisFloor = (VorbisFloor) new VorbisFloor.Floor0(vorbis);
break;
case 1:
vorbisFloor = (VorbisFloor) new VorbisFloor.Floor1(vorbis);
break;
}
if (vorbisFloor == null)
throw new InvalidDataException();
vorbisFloor.Init(packet);
return vorbisFloor;
}
示例13: Init
internal static VorbisResidue Init(VorbisStreamDecoder vorbis, DataPacket packet)
{
int num = (int) packet.ReadBits(16);
VorbisResidue vorbisResidue = (VorbisResidue) null;
switch (num)
{
case 0:
vorbisResidue = (VorbisResidue) new VorbisResidue.Residue0(vorbis);
break;
case 1:
vorbisResidue = (VorbisResidue) new VorbisResidue.Residue1(vorbis);
break;
case 2:
vorbisResidue = (VorbisResidue) new VorbisResidue.Residue2(vorbis);
break;
}
if (vorbisResidue == null)
throw new InvalidDataException();
vorbisResidue.Init(packet);
return vorbisResidue;
}
示例14: VorbisResidue
protected VorbisResidue(VorbisStreamDecoder vorbis)
{
this._vorbis = vorbis;
}
示例15: VorbisMode
private VorbisMode(VorbisStreamDecoder vorbis)
{
_vorbis = vorbis;
}