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::Page - An implementation of Ogg pages
use Audio::TagLib::Ogg::Page; my $i = Audio::TagLib::Ogg::Page->new($file, $pageOffset); my $data = $i->render();
This is an implementation of the pages that make up an Ogg stream. This handles parsing pages and breaking them down into packets and handles the details of packets spanning multiple pages and pages that contiain multiple packets.
In most Xiph.org formats the comments are found in the first few packets, this however is a reasonably complete implementation of Ogg pages that could potentially be useful for non-meta data purposes.
- new(PV $file, IV $pageOffset)
Read an Ogg page from the $file at the position $pageOffset.
Destroys the instance of Page.
- IV fileOffset()
Returns the page's position within the file (in bytes).
- PageHeader header()
Returns the header for this page. This will become invalid when the page is delete.
- IV firstPacketIndex()
Returns the index of the first packet wholly or partially contained in this page.
- void setFirstPacketIndex(IV $index)
Sets the index of the first packet in the page.
When checking to see if a page contains a given packet this set of flags represents the possible values for that packets status in the page.
- PV containsPacket($index)
Checks to see if the specified packet is contained in the current page.
- UV packetCount()
Returns the number of packets (whole or partial) in this page.
- ByteVectorList packets()
Returns a list of the packets in this page.
NOTE Either or both the first and last packets may be only partial.
- IV size()
Returns the size of the page in bytes.
- ByteVector render()
Renders the page to binary format.
Defines a strategy for pagination, or grouping pages into Ogg packets, for use with pagination methods.
NOTE Yes, I'm aware that this is not a canonical "Strategy Pattern", the term was simply convenient.
- LIST paginate(ByteVector $packets, PV $strategy, UV $streamSerialNumber, IV $firstPage, BOOL $firstPacketContinued = FALSE, BOOL $lastPacketCompleted = TRUE, BOOL $containsLastPacket = FALSE) [static]
Packs $packets into Ogg pages using the $strategy for pagination. The page number indicater inside of the rendered packets will start with $firstPage and be incremented for each page rendered. $containsLastPacket should be set to true if $packets contains the last page in the stream and will set the appropriate flag in the last rendered Ogg page's header. $streamSerialNumber should be set to the serial number for this stream.
NOTE The "absolute granule position" is currently always zeroed using this method as this suffices for the comment headers.
This returns a list of all the pages.
None by default.
Dongxu Ma, <email@example.com>
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.