10 Jun 2009 15:13:10 UTC
- Development release
- Distribution: Audio-TagLib
- Module version: 1.41
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (5)
- Testers (0 / 11 / 10)
- KwaliteeBus factor: 1
- License: perl_5
- Activity24 month
- Download (1.45MB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Audio::TagLib::Ogg::PageHeader - An implementation of the page headers associated with each Ogg::Page
use Audio::TagLib::Ogg::PageHeader; my $i = Audio::TagLib::Ogg::PageHeader->new(); $i->setFirstPacketContinued(1); print $i->firstPacketContinued() ? "true" : "false", "\n"; # got "true"
This class implements Ogg page headers which contain the information about Ogg pages needed to break them into packets which can be passed on to the codecs.
- new(PV $file = 0, IV $pageOffset = -1)
Reads a PageHeader from $file starting at $pageOffset. The defaults create a page with no (and as such, invalid) data that must be set later.
Deletes this instance of the PageHeader.
- BOOL isValid()
Returns true if the header parsed properly and is valid.
- LIST packetSizes()
Ogg pages contain a list of packets (which are used by the contained codecs). The sizes of these pages is encoded in the page header. This returns a list of the packet sizes in bytes.
- void setPacketSizes(LIST)
Sets the sizes of the packets in this page to sizes on the stack. Internally this updates the lacing values in the header.
- BOOL firstPacketContinued()
Some packets can be coutinued across multiple pages. If the first packet in the current page is a continuation this will return true. If this is page starts with a new packet this will return false.
- void setFirstPacketContinued(BOOL $continued)
Sets the internal flag indicating if the first packet in this page is continued to $continued.
- BOOL lastPacketCompleted()
Returns true if the last packet of this page is completely contained in this page.
- void setLastPacketCompleted(BOOL $completed)
Sets the internal flag indicating if the last packet in this page is complete to $completed.
- BOOL firstPageOfStream()
This returns true if this is the first page of the Ogg (logical) stream.
- void setFirstPageOfStream(BOOL $first)
Marks this page as the first page of the Ogg stream.
- BOOL lastPageOfStream()
This returns true if this is the last page of the Ogg (logical) stream.
- void setLastPageOfStream(BOOL $last)
Marks this page as the last page of the Ogg stream.
- IV absoluteGranularPosition()
A special value of containing the position of the packet to be interpreted by the codec. In the case of Vorbis this contains the PCM value and is used to calculate the length of the stream.
- void setAbsoluteGranularPosition(IV $agp)
A special value of containing the position of the packet to be interpreted by the codec. It is only supported here so that it may be coppied from one page to another.
- UV streamSerialNumber()
Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. This returns the serial number of the stream associated with this packet.
- void setStreamSerialNumber(UV $n)
Every Ogg logical stream is given a random serial number which is common to every page in that logical stream. This sets this pages serial number. This method should be used when adding new pages to a logical stream.
- IV pageSequenceNumber()
Returns the index of the page within the Ogg stream. This helps make it possible to determine if pages have been lost.
- void setPageSequenceNumber(IV $sequenceNumber)
Sets the page's position in the stream to $sequenceNumber.
- IV size()
Retruns the complete header size.
- IV dataSize()
Returns the size of the data portion of the page -- i.e. the size of the page less the header size.
- ByteVector render()
Render the page header to binary data.
NOTE The checksum -- bytes 22 - 25 -- will be left empty and must be filled in when rendering the entire page.
None by default.
Dongxu Ma, <firstname.lastname@example.org>
Copyright (C) 2005 by Dongxu Ma
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install Audio::TagLib, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Audio::TagLib
For more information on module installation, please visit the detailed CPAN module installation guide.