Audio::File(3pm)
π Audio::File β the manual, but make it cute π
okay so this is the Audio::File page from the User Contributed Perl Documentation section, bestie. it's giving "let me talk to your audio files for you" and honestly? slay.
β¨ NAME β¨
Audio::File β it's an audio file abstraction library π§β¨
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready:
use Audio::File;
my $file = Audio::File->new( "foo.bar" );
print "The ". $file->type() ."-file ". $file->name
." is ". int $file->audio_properties->length() ." seconds long.\n";
print "It's interpreted by ". $file->tag->artist()
." and called ". $file->tag->title() ".\n";
(yes the last line is literally exactly like that in the original, no I will not be fixing it, i am a faithful queen π )
π¦ DESCRIPTION π¦
so basically, Audio::File abstracts a single audio file, and it does it independent of its format. iconic behaviour honestly.
with this module you get to peek at a file's meta-info β think title, album, etc. β plus the file's audio properties like its length and bitrate. the whole main character package π
right now, only these formats are supported:
flacogg vorbismp3
but support for other formats may be easily added, so don't even stress π«Ά
β METHODS β
π new
$file = Audio::File->new( "foobar.flac" );
the constructor, bestie. it takes the filename of your audio file as its only argument and returns an instance of Audio::File::${Type} if the corresponding file type is supported.
how does it know the type? the file extension, obviously. it's reading the vibes off the filename.
currently flac, ogg and mp3 are supported, but new formats may be added easily β you just create an Audio::File::${Type} that inherits from Audio::File::Type, which is the base class for all file type classes π
the methods and behaviour of the returned thing are documented over in Audio::File::Type. go read that one, it's the lore π
π TODO π
the "someday bestie" list:
- add possibility to change file and its tags.
- better (easier) interface?
- user shouldn't be forced to use
Audio::Fileif he only wants the files tag or audio properties. - add possibility to access raw audio data (
Audio::File::Data)- that could be done via
Audio::Dataor equivalent.
- that could be done via
π SEE ALSO π
Audio::File::TypeAudio::File::TagAudio::File::AudioProperties
the friend group π«Ά go say hi.
π AUTHOR π
Florian Ragwitz <flora@cpan.org> β thank you for your service, king πβοΈ
πΈ COPYRIGHT AND LICENSE πΈ
Copyright (C) 2004 Florian Ragwitz
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.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
and that's the whole page bestie!! this one's running under perl v5.36.0 and it was last touched 2022-11-20 β anyway mwah, go read your tags, ily πβ¨π
π¦ where this page comes from
- debian bookworm: libaudio-file-perl 0.11-5 Β· GPL-2.0-or-later
- debian trixie: libaudio-file-perl 0.11-5 Β· GPL-2.0-or-later
- ubuntu noble: libaudio-file-perl 0.11-5 Β· GPL-2.0-or-later
- ubuntu resolute: libaudio-file-perl 0.11-5 Β· GPL-2.0-or-later
- ubuntu stonking: libaudio-file-perl 0.11-5 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms