mp3 analyzer

Hi,

I whant to develop an application that could add ID3 info to
my mp3s, info that would be taken from musicbrainz.org or other db
So I need a library that could analyze the mp3 file and give me some
object that I could use it for retrieving that info.

If
CinarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HappyCactusCommented:
Which kind of information you should retrieve from the MP3? the only metadata you have are the ID3 tags.
0
CinarAuthor Commented:
I'm interested in ID3, I know how to read/write them,
now I'm interested in a library that could somehow analyze the mp3, create a hashcode or something and use that for retrieving ID3 info from musicbrainz.org
0
xelousCommented:
I can't comment about "MusicBrainz" however, when using freedb (http://www.freedb.org) you need to compute an ID for the CD you have taken a track from, you can find all this information on their site in the "Software->Howto" sections:

But in essence, when you connect to their server to identify a track, you need to provide a disc ID.  This is an 8-digit hexadecimal (base-16) number, computed using data from a CD's Table-of-Contents (TOC) in MSF (Minute Second Frame) form.

--- Below is taken directly from the freedb.org "how-to" file regarding generating an ID to use with their service ---

The following is a C code example that illustrates how to generate the CDDB/freedb disc ID. Examples in other programming languages may be found on the freedb web site at http://www.freedb.org in the developers-section. A text description of the algorithm follows, which should contain the necessary information to code the algorithm in any programming language.


struct toc
{
      int      min;
      int      sec;
      int      frame;
};

struct toc cdtoc[100];

int
read_cdtoc_from_drive(void)
{
      /* Do whatever is appropriate to read the TOC of the CD
       * into the cdtoc[] structure array.
       */
      return (tot_trks);
}

int
cddb_sum(int n)
{
      int      ret;

      /* For backward compatibility this algorithm must not change */

      ret = 0;

      while (n > 0) {
            ret = ret + (n % 10);
            n = n / 10;
      }

      return (ret);
}

unsigned long
cddb_discid(int tot_trks)
{
      int      i,
            t = 0,
            n = 0;

      /* For backward compatibility this algorithm must not change */

      i = 0;

      while (i < tot_trks) {
            n = n + cddb_sum((cdtoc[i].min * 60) + cdtoc[i].sec);
            i++;
      }

      t = ((cdtoc[tot_trks].min * 60) + cdtoc[tot_trks].sec) -
          ((cdtoc[0].min * 60) + cdtoc[0].sec);

      return ((n % 0xff) << 24 | t << 8 | tot_trks);
}

main()
{
      int tot_trks;

      tot_trks = read_cdtoc_from_drive();
      printf("The discid is %08x", cddb_discid(tot_trks));
}


This code assumes that your compiler and architecture support 32-bit integers.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

MurpheyApplication ConsultantCommented:
Hi Cinar,

xelous is right, however... you need the exact info from the tracks, so if you rip the MP3 with specific options, like remove silence or a specific compression like Lame, there is a big chance that it's not possible to calculate the right disc ID. On top of that is the calculation based on the "CD's Table-of-Contents (TOC) in MSF (Minute Second Frame)", in a lot of cases, the total time in the TOC is not the same as the summmary of all tracks :-S
So if you have a lot of MP3's and don't have the original disk, there is a big chance that you cant calculate the info.

I'm pretty sure, because I had to tag over 21.000 MP3's and had to do it while ripping or manually because the calculation won't work. By manually processing you can use a tool like "The Godfather", than it will save you manual work becaus this program can generate the info fro the file/path structure.

Regards and good luck,
Murph
0
EE_AutoDeleterCommented:
I've requested that this question be deleted for the following reason:

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Not enough information to confirm an answer.

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Auto Deleter
0
MurpheyApplication ConsultantCommented:
xelous and I give enough information, so I assume the problem is solved and  Cinar is not willing to assign the answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.