本文整理汇总了C#中StreamState.pagein方法的典型用法代码示例。如果您正苦于以下问题:C# StreamState.pagein方法的具体用法?C# StreamState.pagein怎么用?C# StreamState.pagein使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StreamState
的用法示例。
在下文中一共展示了StreamState.pagein方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: main
//.........这里部分代码省略.........
Console.Error.WriteLine(e);
return;
}
SyncState.wrote(bytes);
// Get the first page.
int _result = SyncState.PageOut(Page);
if (_result != 1)
{
// have we simply run out of data? If so, we're done.
if (bytes < 4096) break;
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)
{