Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by andyford (Curate)
on Oct 24, 2007 at 13:05 UTC ( #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


Comment on Re: Adding "album art" to MP3s ...
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-07-10 02:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls