Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Testing for quality of audio in MP3's

by Stegalex (Chaplain)
on Aug 26, 2002 at 16:36 UTC ( #192931=perlquestion: print w/replies, xml ) Need Help??

Stegalex has asked for the wisdom of the Perl Monks concerning the following question:

Here's a question from a non-engineer - there, I admitted it so please, no flaming replies.

Let's say that a person uses Kazaa or another file sharing service to share MP3s. The file sharing service lists the audio sampling rate for each file but this does not have much to do with the quality of the recording. Many of the high bitrate audio files seem damaged. Apparently the RIAA and others have begun sharing intentionally damaged files to thwart intellectual property theft.

So, my question is this: which Perl modules (if any) would help me to automatically inspect an MP3 file and determine if it's somehow damaged (blank spots, static, etc)? I know it's not easy to do and that the term "damage" is highly subjective, but is there anything a person can do short of actually listening to these files?

I like chicken.

Replies are listed 'Best First'.
Re: Testing for quality of audio in MP3's
by Corion (Patriarch) on Aug 26, 2002 at 16:49 UTC

    As most of the quality degradation is most likely done by a program as well, you could bring up your hex editor and try to recognize patterns, either in the encoded mp3 file or in the decoded PCM stream. For example, there are click-removal algorithms - those include click-detection, and if a file has too many clicks, it's most likely damaged.

    But there are certain limits to those detection mechanisms, as simply using a too-low bitrate will degrade the quality of a record to an unacceptable level. Simply decoding the mp3 and then deciding whether the decoded result has acceptable quality is very hard, if you consider different kinds of synthesizer tracks - there are some very clean synthesizer sounds, but there are also filtered and voluntarily distorted sounds - your algorithm would have to determine whether that distortion was intrinsic to the original record or came to be through malintent manipulation - an impossible task.

    So I guess it's simply easier to just record all your CDs instead of downloading them from the internet...

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
Re: Testing for quality of audio in MP3's
by cLive ;-) (Prior) on Aug 26, 2002 at 21:05 UTC
    "...but is there anything a person can do short of actually listening to these files?"

    Yes, you can go out and buy the CD if you like the artist to prove to the RIAA and others that file sharing is constructive towards their business model and maybe they should leave it alone :)


    cLive ;-)


    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://192931]
Approved by grinder
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-12-06 20:10 GMT
Find Nodes?
    Voting Booth?

    No recent polls found