LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-04-2009, 08:46 PM   #1
ifeatu
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 68

Rep: Reputation: 15
Using Perl Mods to edit mp3 meta tags


Hello,

Im relatively new to Perl and I want to use Perl to write a simple script that takes a file name and chops it up and puts the contents into the meta tag of the file it came from (mp3).

eg

Filename: Jan_03_1991_The_Sufferings_of_Christ_BLH_Side_1.mp3

MetaTags:

Year: 1991
Album Name (In this order): 1991-01-03- The_Sufferings_of_Christ -BLH
Track Number: 1


So I installed the Perl mod from cpan for mp3::tag ID3 but have no idea how to begin to use it.

Can anyone help?
 
Old 12-04-2009, 09:36 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,769

Rep: Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614Reputation: 2614
Quote:
Originally Posted by ifeatu View Post
Hello,

Im relatively new to Perl and I want to use Perl to write a simple script that takes a file name and chops it up and puts the contents into the meta tag of the file it came from (mp3).

eg

Filename: Jan_03_1991_The_Sufferings_of_Christ_BLH_Side_1.mp3

MetaTags:

Year: 1991
Album Name (In this order): 1991-01-03- The_Sufferings_of_Christ -BLH
Track Number: 1


So I installed the Perl mod from cpan for mp3::tag ID3 but have no idea how to begin to use it.

Can anyone help?
Yes, we can help. Post what you've written, and where you're getting stuck. You can also go out to CPAN and read the usage notes for the module, that explain how to use it.

You can also try perlmonks.com, for more perl-specific programming questions...they may already have code snippets out there too.
 
Old 12-04-2009, 10:18 PM   #3
ifeatu
Member
 
Registered: Sep 2008
Distribution: Fedora 9
Posts: 68

Original Poster
Rep: Reputation: 15
Learning step by step

okay,

This is what I have done to learn how the module works, basically I just want to grab the metatag info that is already on the track and print it to the screen

This is what I have so far

Code:
 
  use MP3::Tag;
  
  $filename = d:\\Pierres_Tape_Library\\Labeled_Tracks\\April_20_1984_side_1.mp3;
  $mp3 = MP3::Tag->new($filename);

  $mp3->get_tags();
  $id3v2 = $mp3->{ID3v2} if exists $mp3->{ID3v2};

  print "The information in the metatag for the file is: $id3v2";
So I just get errors such as

Code:
Can't call method "get_tags" on an undefined value at mp3test.pl line 14
I DID install the module.

Last edited by ifeatu; 12-04-2009 at 10:19 PM.
 
Old 12-06-2009, 10:19 AM   #4
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 62
why don't you get this moved to the Programming section?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
eog and nautilus meta tags MikeyCarter Linux - Software 0 12-23-2007 11:33 AM
MP3 ID3 Tag/Meta Data heri0n Linux - Software 2 08-28-2006 10:45 AM
Cant Edit tags in amaroK TanSahara Linux - Software 3 01-22-2006 11:19 AM
Amarok Edit Meta Data Crash Boffy Linux - Software 0 11-24-2004 02:16 AM
Program to edit Meta-Info of jpg files phase9 Linux - Software 2 08-03-2004 01:42 AM


All times are GMT -5. The time now is 04:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration