Audio::File(3pm)

πŸ“¦
version 0.11 Β· 2 versions
  • 0.11 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.11 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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:

  • flac
  • ogg vorbis
  • mp3

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::File if 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::Data or equivalent.

πŸ‘‘ SEE ALSO πŸ‘‘

  • Audio::File::Type
  • Audio::File::Tag
  • Audio::File::AudioProperties

the friend group 🫢 go say hi.


πŸ’œ AUTHOR πŸ’œ

Florian Ragwitz <flora@cpan.org> β€” thank you for your service, king πŸ™‡β™€οΈ


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 πŸ’–βœ¨πŸŽ€