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


C# Info.synthesis_headerin方法代码示例

本文整理汇总了C#中Info.synthesis_headerin方法的典型用法代码示例。如果您正苦于以下问题:C# Info.synthesis_headerin方法的具体用法?C# Info.synthesis_headerin怎么用?C# Info.synthesis_headerin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Info的用法示例。


在下文中一共展示了Info.synthesis_headerin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: main


//.........这里部分代码省略.........
                    Console.WriteLine(bytes + "; " + _result);
                    //File.WriteAllBytes();
                    // error case.  Must not be Vorbis data
                    Console.Error.WriteLine("Input does not appear to be an Ogg bitstream.");
                    return;
                }

                // Get the serial number and set up the rest of decode.
                // serialno first; use it to set up a logical stream
                StreamState.Init(Page.serialno());

                // extract the initial header from the first page and verify that the
                // Ogg bitstream is in fact Vorbis data

                // I handle the initial header first instead of just having the code
                // read all three Vorbis headers at once because reading the initial
                // header is an easy way to identify a Vorbis bitstream and it's
                // useful to see that functionality seperated out.

                Info.init();
                Comment.init();
                if (StreamState.pagein(Page) < 0)
                {
                    // error; stream version mismatch perhaps
                    throw (new Exception("Error reading first page of Ogg bitstream data."));
                }

                if (StreamState.PacketOut(Packet) != 1)
                {
                    // no page? must not be vorbis
                    throw (new Exception("Error reading initial header packet."));
                }

                if (Info.synthesis_headerin(Comment, Packet) < 0)
                {
                    // error case; not a vorbis header
                    throw (new Exception("This Ogg bitstream does not contain Vorbis audio data."));
                }

                // At this point, we're sure we're Vorbis.  We've set up the logical
                // (Ogg) bitstream decoder.  Get the comment and codebook headers and
                // set up the Vorbis decoder

                // The next two packets in order are the comment and codebook headers.
                // They're likely large and may span multiple pages.  Thus we reead
                // and submit data until we get our two pacakets, watching that no
                // pages are missing.  If a page is missing, error out; losing a
                // header page is the only place where missing data is fatal. */

                int i = 0;
                while (i < 2)
                {
                    while (i < 2)
                    {

                        int result = SyncState.PageOut(Page);
                        if (result == 0)
                            break; // Need more data
                        // Don't complain about missing or corrupt data yet.  We'll
                        // catch it at the packet output phase

                        if (result == 1)
                        {
                            StreamState.pagein(Page); // we can ignore any errors here
                            // as they'll also become apparent
                            // at packetout
开发者ID:hermitdave,项目名称:nvorbis,代码行数:67,代码来源:DecodeExample.cs


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