Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Adding "album art" to MP3s ...

by andyford (Curate)
on Oct 24, 2007 at 13:05 UTC ( [id://646886]=note: print w/replies, xml ) Need Help??


in reply to Adding "album art" to MP3s ...

#!/usr/bin/perl use warnings; use strict; use MP3::Tag; my $artfile = 'barred-spiral-NGC1512.jpg'; my $art; { local $/=undef; open my $jpg,'<', $artfile or die "Couldn't open file: $!"; binmode $jpg; $art = <$jpg>; close $jpg; } my $mp3 = MP3::Tag->new('Andrew_Ford__Cygnus_X1_Trawler.mp3'); $mp3->get_tags(); $mp3->{ID3v2}->change_frame("APIC", chr(0x0), 'image/jpeg', chr(0x0), +'Cover Art', $art); $mp3->update_tags(); $mp3->close();

non-Perl: Andy Ford

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://646886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found