]> iEval git - audio-opusfile.git/blobdiff - lib/Audio/Opusfile.pm
Add Audio::Opusfile::Head
[audio-opusfile.git] / lib / Audio / Opusfile.pm
index e0546ba435f09e2a77f964735c3c909697c5010a..3c6a7c2d93990bf474dc9b51efa0e85fdab1e604 100644 (file)
@@ -46,7 +46,7 @@ my @constants =
 our @EXPORT_OK = @constants;
 our @EXPORT = @constants;
 
-our $VERSION = '0.002001';
+our $VERSION = '0.003';
 
 sub AUTOLOAD {
     # This AUTOLOAD is used to 'autoload' constants from the constant()
@@ -73,6 +73,7 @@ sub AUTOLOAD {
 
 require XSLoader;
 XSLoader::load('Audio::Opusfile', $VERSION);
+require Audio::Opusfile::Head;
 require Audio::Opusfile::Tags;
 require Audio::Opusfile::PictureTag;
 
@@ -117,8 +118,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.
 
@@ -132,6 +134,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.
@@ -140,6 +158,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
@@ -183,6 +220,7 @@ All constants are exported by default:
 
 =head1 SEE ALSO
 
+L<Audio::Opusfile::Head>,
 L<Audio::Opusfile::Tags>,
 L<http://opus-codec.org/>,
 L<http://opus-codec.org/docs/opusfile_api-0.7/index.html>
This page took 0.024435 seconds and 4 git commands to generate.