Thanks for the uhhh... pointers (wrong language?). As a newbie, when I "use
strict" I end up chasing so many rabbits down blind holes that I spend days
troubleshooting issues that have nothing to do with my program. I realize I
will have to apply the discipline at some point... for now, writing code on my
own time/dime, I persist with the bare minimum "-w". If you have dire warnings
(hehe) with regard to this approach, I'm all ears.
Yes, you are right, I added the comments to the listserv posting-- which were
invalid in Perl-ese.
BINGO! You pointed out my ASS-umption that there was a FALSE literal defined
inherently in Perl! :)
Changing the config entry to:
MP3::Tag->config("id3v23_unsync",0);
fixed the problem with iTunes.
The following code is working "as expected". iTunes sees all now (so the
id3v23_unsync issue still exists in iTunes version 7.x). Somehow iTunes 7.2
can even pull in the album cover (from a very obscure Audio Bible)... which is
a bit scary since it means that iTunes is getting very "big brotherish" in its
abitlity to determine exactly what music you have loaded (not that that should
be a problem for anyone who's listening to... the Bible).
Thanks again for your help!
Kind Regards!
GL
#!/usr/bin/perl -w
use MP3::Tag;
MP3::Tag->config("id3v23_unsync",0);
my $filename = $ARGV[0];
$mp3 = MP3::Tag->new($filename);
@info = $mp3->autoinfo();
@albnum = split(/_/, $info[3]);
#my ($title, $frame);
$frame = $mp3->{ID3v2}->get_frame("TIT2");
print $frame;
$mp3->{ID3v1}->title("$albnum[0] $info[0]");
$mp3->{ID3v2}->change_frame("TIT2","$albnum[0] $info[0]");
$mp3->{ID3v1}->write_tag();
$mp3->{ID3v2}->write_tag();
@info=$mp3->autoinfo;
print $info[0];
$frame = $mp3->{ID3v2}->get_frame("TIT2");
print $frame;
# @tags = $mp3->get_tags;
# print "\n @tags";
$mp3->close();
Message: 4
Date: Thu, 28 Jun 2007 10:01:41 +0100
From: "Brian Raven"
Subject: RE: MP3::Tag - iTunes cannot read ID3 tags written by
MP3::Tag?
To:
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="ISO-8859-1"
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 28 June 2007 04:52
To: [email protected]
Subject: MP3::Tag - iTunes cannot read ID3 tags written by MP3::Tag?
> Greetings,
>
> Just trying to re-arrange ID3 information in a large set of MP3
> files. Before I run the following Perl script, iTunes can read the
ID3
> tagging information. After writing ID3 information to the MP3, iTunes
no
> longer reads any tagging information from the MP3.
>
> Does anyone have any information regarding this? There is some
> cryptic information in the MP3::Tag POD regarding setting the
> "id3v23_unsync" option but that doesn't seem to alter the impact on
iTunes at all.
> Windows and other tag readers seem to be able to read the all ID3v1
and
> ID3v2 tags just fine (including the altered fields) after running the
> following script.
>
> Thanks for any suggestions/guideance anyone can provide.
>
> Description: the following program takes an MP3 filename as input.
> Action: It appends the value in the Album field to front of the
> TITLE Field. That's it! Easy!
>
> #!/usr/bin/perl -w
> use MP3::Tag;
> MP3::Tag->config(id3v23_unsync=>FALSE);
> my $filename = $ARGV[0];
> $mp3 = MP3::Tag->new($filename);
> @info=$mp3->autoinfo;
> @albnum = split(/_/, $info[3]);
>
> $frame = $mp3->{ID3v2}->get_frame("TIT2");
> print $frame;
>
> $mp3->{ID3v1}->title("$albnum[0] $info[0]");
> $mp3->{ID3v2}->change_frame("TIT2","$albnum[0] $info[0]");
>
> $mp3->{ID3v1}->write_tag();
> $mp3->{ID3v2}->write_tag();
>
> @info=$mp3->autoinfo;
> print $info[0]; //print ID3v1 TITLE field
>
> $frame = $mp3->{ID3v2}->get_frame("TIT2");
> print $frame; //print ID3v2 Title2 field
>
> $mp3->close();
>
First, always start with "use strict;", and "use warnings;" is better
than -w.
Second, it is better to post real code, i.e. cut&paste code that you
have actually run. The lines containing '//' where you probably meant
'#' indicate that this may not the case here, as they produce syntax
errors.
If you had used strictures it would have complained to you about the
bareword "FALSE", which might have given you a clue to what your problem
might be. For a further clue try the following at the command line:
perl -e "if(FALSE){print qq{true\n}} else {print qq{false\n}}"
That is, FALSE as a bareword evaluates to true. Try using a value that
really evaluates to false, like 0 (zero).
I don't know whether your script will work after making the above
change. My comments are based solely on the code you posted and the
documentation for MP3::Tag. I have no knowledge about what you are
trying to do.
Not sure what you mean about the id3v23_unsync info being cryptic ("Some
broken MP3 players (e.g., ITunes, at least up to v6) refuse to handle
unsyncronized (e.g., written as the standard requires it) tags; they may
need this to be set to FALSE. Default: TRUE."). Indeed, apart from
taking TRUE/FALSE a bit too literally, you seem to have understood it
well enough.
HTH
--
Brian Raven
=========================================
Atos Euronext Market Solutions Disclaimer
=========================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with
registration no. 3962327. Registered office address at 25 Bank Street London
E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with registration no.
425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris
France.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci?t? de droit anglais, enregistr?e au
Royaume Uni sous le num?ro 3962327, dont le si?ge social se situe 25 Bank
Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci?t? par actions simplifi?e, enregistr?
au registre dui commerce et des soci?t?s sous le num?ro 425 100 294 RCS Paris
et dont le si?ge social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================
------------------------------
Message: 5
Date: Thu, 28 Jun 2007 04:36:20 -0700
From: Bill Luebkert
Subject: Re: MP3::Tag - iTunes cannot read ID3 tags written by
MP3::Tag?
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Brian Raven wrote:
>
> and "use warnings;" is better
> than -w.
To the best of my knowledge, use warnings is only *better* in that it
gives you more control than -w. -w should report all warnings (the same
as use warnings 'all') from my reading of docs. If you need to selectively
turn on and off various warnings, that's where use warnings is more useful.
------------------------------
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
End of ActivePerl Digest, Vol 11, Issue 22
******************************************
---------------------------------
Got a little couch potato?
Check out fun summer activities for kids._______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs