Ogg::V...urePerl(3pm)
π Ogg::Vorbis::Header::PurePerl π
okay so bestie, welcome to the User Contributed Perl Documentation corner of the internet, where we're talking about Ogg::Vorbis::Header::PurePerl β yes the whole name, it's long, it's giving β¨commitmentβ¨, we love her for it. And if you're like "wait, that (3pm) is doing something" β that's just the manpage section, it's fine, breathe. π«Ά
πΈ NAME πΈ
Ogg::Vorbis::Header::PurePerl β for peeking at your Ogg Vorbis info and comment fields. That's the whole job. She's not doing your taxes. π
β¨ SYNOPSIS β¨
Here's the vibe, copy-paste girlies:
use Ogg::Vorbis::Header::PurePerl;
my $ogg = Ogg::Vorbis::Header::PurePerl->new("song.ogg");
while (my ($k, $v) = each %{$ogg->info}) {
print "$k: $v\n";
}
foreach my $com ($ogg->comment_tags) {
print "$com: $_\n" foreach $ogg->comment($com);
}
Look at her go. Load it, open a file, dump the info hash, loop the comment tags, loop the comments inside each tag. Chef's kiss. π
π¦ DESCRIPTION π¦
So the whole point: this module is meant to be a drop in replacement for Ogg::Vorbis::Header, except it's implemented entirely in Perl π. No C compiler nonsense. It gives you an object-oriented interface to Ogg Vorbis information and comment fields.
NOTE: This module currently supports only read operations. Read. Only. Do not come for her about writing, she said what she said. π
And here's the glow-up that makes her different from Ogg::Vorbis::Header: this module will go ahead and fill in all of the information fields as soon as you construct the object. No lazy loading, no waiting around. She's an overachiever, it's her main character era π
π CONSTRUCTORS π
π« new ($filename)
Opens an Ogg Vorbis file β and she's thorough about it: she checks that it exists and that it's actually an Ogg Vorbis stream. π
But plot twist, and I need you to hear me: this method does not actually read any of the information or comment fields, and it closes the file immediately. That's right, she opens it, checks it, says "yep, valid, mwah π" and dips. Iconic behaviour honestly.
π INSTANCE METHODS π
π info ([$key])
Returns a hashref stuffed with info about the Ogg Vorbis file, pulled straight from the file's information header.
The hash fields are:
versionchannelsratebitrate_upperbitrate_nominalbitrate_lowerbitrate_windowlength
Quick heads up: thebitrate_windowvalue is not currently used by the vorbis codec, and will always be-1. She's just there, sitting in the corner, being -1. Respect her journey. π
The optional parameter, key, lets you grab a single value out of the object's hash. And if the key isn't found? Returns undef. No drama, no error, just undef. π
π§ comment_tags ()
Returns an array with the key values for the comment fields. Then you can hand those values straight to comment to get their actual values. It's a two-step, but it's a cute two-step. π
β comment ($key)
Returns an array of comment values that are associated with the given key. Simple as. β¨
π add_comments ($key, $value, [$key, $value, ...])
Unimplemented. She said no. π
π edit_comment ($key, $value, [$num])
Unimplemented. Not today, bestie. π
π delete_comment ($key, [$num])
Unimplemented. The delete button is decorative. π
π clear_comments ([@keys])
Unimplemented. Nothing to see here. π
π write_vorbis ()
Unimplemented. Read-only era, remember? π₯
πΈ path ()
Returns the path/filename of the file that the object represents. Like, "which file are you, girl?" and she tells you. Precisely. π
π SEE ALSO π
Ogg::Vorbis::Decoderβ a module for decoding Ogg Vorbis files. Requires a C compiler. (yeah, a whole compiler, she's high maintenance but she's worth it β¨)Ogg::Vorbis::Headerβ another module for accessing Ogg Vorbis header info.Ogg::Vorbisβ a perl interface to thelibvorbisfile<http://www.xiph.org/vorbis/doc/vorbisfile/> library, for decoding and manipulating Vorbis audio streams.
π«Ά REPOSITORY π«Ά
Go say hi, star the repo, be normal about it:
<https://github.com/dsully/perl-ogg-vorbis-header-pureperl>
π AUTHOR π
Credit where credit is due, the legends behind her:
- Andrew Molloy
<amolloy@kaizolabs.com> - Dan Sully
<daniel | at | cpan.org>
π COPYRIGHT π
- Copyright (c) 2003, Andrew Molloy. All Rights Reserved.
- Copyright (c) 2005-2009, Dan Sully. All Rights Reserved.
And the legal bit, which is important, don't skip it:
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. A copy of this license is included with this module (LICENSE.GPL).
π SEE ALSO π
yes, again, she's thorough:
Ogg::Vorbis::HeaderOgg::Vorbis::Decoder
okay that's the whole page bestie, you ate it, every last line πβ¨ This little love letter to Ogg::Vorbis::Header::PurePerl shipped as part of perl v5.32.0, dated 2020-12-08, in the fine tradition of User Contributed Perl Documentation. Now go read some Ogg Vorbis comment fields. Periodt. π
π
π¦ where this page comes from
- debian bookworm: libogg-vorbis-header-pureperl-perl 1.05-1 Β· GPL-2.0-or-later
- debian trixie: libogg-vorbis-header-pureperl-perl 1.05-1 Β· GPL-2.0-or-later
- ubuntu jammy: libogg-vorbis-header-pureperl-perl 1.05-1 Β· GPL-2.0-or-later
- ubuntu noble: libogg-vorbis-header-pureperl-perl 1.05-1 Β· GPL-2.0-or-later
- ubuntu resolute: libogg-vorbis-header-pureperl-perl 1.05-1 Β· GPL-2.0-or-later
- ubuntu stonking: libogg-vorbis-header-pureperl-perl 1.05-1 Β· 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