]> iEval git - audio-opusfile.git/blobdiff - lib/Audio/Opusfile.pm
Minor doc fix
[audio-opusfile.git] / lib / Audio / Opusfile.pm
index e3e2f41c2932c94bc19dca4f06ad32a165596f0b..d890005cbcca5e2e4e2ef9422b66008980ff65ce 100644 (file)
@@ -83,6 +83,11 @@ sub new_from_file {
        open_file($file)
 }
 
+sub new_from_memory {
+       my ($class, $buf) = @_;
+       open_memory($buf)
+}
+
 1;
 __END__
 
@@ -112,8 +117,9 @@ libopusfile is a library for decoding and basic manipulation of Ogg
 Opus files.
 
 Audio::Opusfile is an interface to libopusfile. At the moment its only
-function is reading metadata and tags from an Ogg Opus file. Future
-versions will give access to a larger part of the libopusfile API.
+function is reading metadata and tags from an Ogg Opus file or buffer.
+Future versions will give access to a larger part of the libopusfile
+API.
 
 Expect the API to change in future versions.
 
@@ -127,6 +133,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<new_from_memory>(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<Audio::Opusfile::Head> object corresponding to the file.
@@ -135,6 +157,25 @@ Returns an L<Audio::Opusfile::Head> object corresponding to the file.
 
 Returns an L<Audio::Opusfile::Tags> 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
This page took 0.019984 seconds and 4 git commands to generate.