X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FAudio%2FOpusfile.pm;h=8f1e90e5aae07c71aaac90edbc2a63e1192bdc7b;hb=dc986a40f5a09844558d50c2017667de606ab6f5;hp=3c6a7c2d93990bf474dc9b51efa0e85fdab1e604;hpb=b9bd6a0d2a03539515f640a43bad1f54dca8b0b5;p=audio-opusfile.git diff --git a/lib/Audio/Opusfile.pm b/lib/Audio/Opusfile.pm index 3c6a7c2..8f1e90e 100644 --- a/lib/Audio/Opusfile.pm +++ b/lib/Audio/Opusfile.pm @@ -177,6 +177,49 @@ 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. +=item B<$of>->op_raw_total([I<$link_index>]) + +Get the total (compressed) size of the stream (with no arguments), or +of an individual link in a (possibly-chained) Ogg Opus stream (with +one nonnegative argument), including all headers and Ogg muxing +overhead. + +The stream must be seekable to get the total. A negative value is +returned if the stream is not seekable. + +B If the Opus stream (or link) is concurrently multiplexed +with other logical streams (e.g., video), this returns the size of the +entire stream (or link), not just the number of bytes in the first +logical Opus stream. Returning the latter would require scanning the +entire file. + +=item B<$of>->op_pcm_total([I<$link_index>]) + +Get the total PCM length (number of samples at 48 kHz) of the stream +(with no arguments), or of an individual link in a (possibly-chained) +Ogg Opus stream (with one nonnegative argument). + +Users looking for op_time_total() should use this function instead. +Because timestamps in Opus are fixed at 48 kHz, there is no need for a +separate function to convert this to seconds. + +The stream must be seekable to get the total. A negative value is +returned if the stream is not seekable. + +=item B<$of>->op_bitrate([I<$link_index>]) + +Computes the bitrate of the stream (with no arguments), or of an +individual link in a (possibly-chained) Ogg Opus stream (with one +nonnegative argument). + +The stream must be seekable to compute the bitrate. A negative value +is returned if the stream is not seekable. + +B If the Opus stream (or link) is concurrently multiplexed with +other logical streams (e.g., video), this uses the size of the entire +stream (or link) to compute the bitrate, not just the number of bytes +in the first logical Opus stream. + =back =head1 EXPORT