X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FAudio%2FOpusfile.pm;h=1e37f4bf580365be25e235f844006c34b05cacf7;hb=33fac129d4e945160adac31b73dd04e90d78bc50;hp=e0546ba435f09e2a77f964735c3c909697c5010a;hpb=5fbea9a258070b0c9e770e80aa52d17d66730d44;p=audio-opusfile.git diff --git a/lib/Audio/Opusfile.pm b/lib/Audio/Opusfile.pm index e0546ba..1e37f4b 100644 --- a/lib/Audio/Opusfile.pm +++ b/lib/Audio/Opusfile.pm @@ -132,6 +132,22 @@ Creates a new Audio::Opusfile object from an Ogg Opus file. Dies if the given file does not exist or is not a valid Ogg Opus file. +=item Audio::Opusfile->B(I<$buffer>) + +Creates a new Audio::Opusfile object from a buffer containing Ogg Opus +data. + +Dies if the given buffer does not contain valid data. + +=item Audio::Opusfile::test(I<$buffer>) + +Returns true if the given buffer looks like the beginning of a valid +Ogg Opus file, false otherwise. + +Dies if the given buffer does not have sufficient data to tell if it +is an Opus stream or if it looks like a Opus stream but parsing it +failed. + =item B<$of>->head Returns an L object corresponding to the file. @@ -140,6 +156,25 @@ Returns an L object corresponding to the file. Returns an L object corresponding to the file. +=item B<$of>->seekable + +Returns whether or not the data source being read is seekable. + +=item B<$of>->link_count + +Returns the number of links in this chained stream. Always returns 1 +for unseekable sources. + +=item B<$of>->serialno([I<$link_index>]) + +Get the serial number of the given link in a (possibly-chained) Ogg +Opus stream. If the given index is greater than the total number of +links, this returns the serial number of the last link. + +If the source is not seekable, I<$link_index> is negative, or +I<$link_index> is not given, then this function returns the serial +number of the current link. + =back =head1 EXPORT