.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Decoder 3pm" .TH Decoder 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Audio::FLAC::Decoder \- An object\-oriented FLAC decoder .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 6 \& use Audio::FLAC::Decoder; \& my $decoder = Audio::FLAC::Decoder\->open("song.flac"); \& my $buffer; \& while ((my $len = $decoder\->sysread($buffer) > 0) { \& # do something with the PCM stream \& } \& \& OR \& \& open FLAC, "song.flac" or die $!; \& my $decoder = Audio::FLAC::Decoder\->open(\e*FLAC); \& \& OR \& \& # can also be IO::Socket or any other IO::Handle subclass. \& my $fh = IO::Handle\->new("song.flac"); \& my $decoder = Audio::FLAC::Decoder\->open($fh); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides users with Decoder objects for FLAC files. One can read data in PCM format from the stream, seek by pcm samples, or time. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" .ie n .SS """open ($filename)""" .el .SS "\f(CWopen ($filename)\fP" .IX Subsection "open ($filename)" Opens an FLAC file for decoding. It opens a handle to the file or uses an existing handle and initializes all of the internal FLAC decoding structures. Note that the object will maintain open file descriptors until the object is collected by the garbage handler. Returns \f(CW\*(C`undef\*(C'\fR on failure. .SH "INSTANCE METHODS" .IX Header "INSTANCE METHODS" .ie n .SS """sysread ($buffer, [$size])""" .el .SS "\f(CWsysread ($buffer, [$size])\fP" .IX Subsection "sysread ($buffer, [$size])" Reads PCM data from the FLAC stream into \f(CW$buffer\fR. Returns the number of bytes read, 0 when it reaches the end of the stream, or a value less than 0 on error. The optional size can specify how many bytes to read. .ie n .SS """raw_seek ($pos)""" .el .SS "\f(CWraw_seek ($pos)\fP" .IX Subsection "raw_seek ($pos)" Seeks through the compressed bitstream to the offset specified by \&\f(CW$pos\fR in raw bytes. Returns 0 on success. .ie n .SS """sample_seek ($pos)""" .el .SS "\f(CWsample_seek ($pos)\fP" .IX Subsection "sample_seek ($pos)" Seeks through the bitstream to the offset specified by \f(CW$pos\fR in pcm samples. Returns 0 on success. .ie n .SS """time_seek ($pos, [$page])""" .el .SS "\f(CWtime_seek ($pos, [$page])\fP" .IX Subsection "time_seek ($pos, [$page])" Seeks through the bitstream to the offset specified by \f(CW$pos\fR in seconds. Returns 0 on success. .ie n .SS """bitrate ([$stream])""" .el .SS "\f(CWbitrate ([$stream])\fP" .IX Subsection "bitrate ([$stream])" Returns the average bitrate for the specified logical bitstream. If \&\f(CW$stream\fR is left out or set to \-1, the average bitrate for the entire stream will be reported. .ie n .SS """time_total ([$stream])""" .el .SS "\f(CWtime_total ([$stream])\fP" .IX Subsection "time_total ([$stream])" Returns the total number of seconds in the bitstream. .ie n .SS """raw_tell ()""" .el .SS "\f(CWraw_tell ()\fP" .IX Subsection "raw_tell ()" Returns the current offset in bytes. .ie n .SS """time_tell ()""" .el .SS "\f(CWtime_tell ()\fP" .IX Subsection "time_tell ()" Returns the current offset in seconds. \- NOT YET IMPLEMENTED .SH REQUIRES .IX Header "REQUIRES" libFLAC .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2004\-2008, Dan Sully. All Rights Reserved. .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .SH "SEE ALSO" .IX Header "SEE ALSO" Audio::FLAC::Header