in reply to OGG Vorbis tag parsing in pure perl
It is probably still better to implement something that conforms to the docs (http://reactor-core.org/ogg-tag-standard.html, http://www.xiph.org/ogg/vorbis/doc/v-comment.html).package gnump3d::oggtagreader; # untested sub new { bless \(undef), shift } sub get_tags { my($self, $filename) = @_; # using lexical filehandles is much safer # die()ing here is probably not the best way to handle failures he +re open(my ($fh), "<", $filename) or return; binmode $fh; read $fh, my ($buffer), 2048; $buffer =~ s/[[:^print:]]/=/g; my %info = map +($_ => /$_=([^=]+)/i), qw(artist title album comment genre tracknumber); $info{track} = delete $info{tracknumber} if exists $info{tracknumber}; return %info; } 1;
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OGG Vorbis tag parsing in pure perl
by skx (Parson) on Dec 17, 2002 at 23:26 UTC | |
|
Re: Re: OGG Vorbis tag parsing in pure perl
by Wonko the sane (Curate) on Dec 31, 2002 at 15:50 UTC | |
by Aristotle (Chancellor) on Dec 31, 2002 at 17:11 UTC |