当前位置: 首页>>代码示例>>C#>>正文


C# NVorbis.VorbisStreamDecoder类代码示例

本文整理汇总了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;
        }
开发者ID:chen-ye,项目名称:SoundStockUnity,代码行数:33,代码来源:VorbisMode.cs

示例2: Init

 internal static VorbisCodebook Init(VorbisStreamDecoder vorbis, DataPacket packet, int number)
 {
     var temp = new VorbisCodebook();
     temp.BookNum = number;
     temp.Init(packet);
     return temp;
 }
开发者ID:mokujin,项目名称:DN,代码行数:7,代码来源:VorbisCodebook.cs

示例3: Init

 internal static VorbisCodebook Init(VorbisStreamDecoder vorbis, DataPacket packet, int number)
 {
   VorbisCodebook vorbisCodebook = new VorbisCodebook();
   vorbisCodebook.BookNum = number;
   vorbisCodebook.Init(packet);
   return vorbisCodebook;
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:7,代码来源:VorbisCodebook.cs

示例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;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:27,代码来源:VorbisMode.cs

示例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];
            }
        }
开发者ID:YJh2046,项目名称:BlockFun,代码行数:10,代码来源:VorbisResidue.cs

示例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;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:11,代码来源:VorbisTime.cs

示例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;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:11,代码来源:VorbisMapping.cs

示例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;
        }
开发者ID:YJh2046,项目名称:BlockFun,代码行数:14,代码来源:VorbisMapping.cs

示例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;
        }
开发者ID:reidyd,项目名称:nvorbis,代码行数:14,代码来源:VorbisTime.cs

示例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;
        }
开发者ID:reidyd,项目名称:nvorbis,代码行数:15,代码来源:VorbisFloor.cs

示例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;
        }
开发者ID:reidyd,项目名称:nvorbis,代码行数:16,代码来源:VorbisResidue.cs

示例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;
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:18,代码来源:VorbisFloor.cs

示例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;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:21,代码来源:VorbisResidue.cs

示例14: VorbisResidue

 protected VorbisResidue(VorbisStreamDecoder vorbis)
 {
   this._vorbis = vorbis;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:4,代码来源:VorbisResidue.cs

示例15: VorbisMode

 private VorbisMode(VorbisStreamDecoder vorbis)
 {
     _vorbis = vorbis;
 }
开发者ID:chen-ye,项目名称:SoundStockUnity,代码行数:4,代码来源:VorbisMode.cs


注:本文中的NVorbis.VorbisStreamDecoder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。