[Tutor] mp3 range violation reportage.

Tesla Coil tescoil@irtc.net
Sun, 27 May 2001 22:38:17 -0500


First, a sorry-as-brief-as-I-can-manage-but-hopefully
not-so-brief-absolutely-no-one-comprehends briefing on 
mpg123 command line options, beginning with an example:

$ mpg123 -t -c Raw_Power.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
Title  : Raw Power                       Artist: The Stooges            
Album  : Raw Power                       Year  : 1973
Comment:                                 Genre : Punk Rock

Playing MPEG stream from Raw_Power.mp3 ...
MPEG 1.0 layer III, 128 kbit/s, 44100 Hz stereo
2 samples clipped
2 samples clipped
2 samples clipped
1 samples clipped

[4:21] Decoding of Raw_Power.mp3 finished

-t is test mode, doesn't play any sound, and faster.
-c checks for range violations, the "samples clipped" stuff.

One could also do mpg123 -t -c -@ playlist.m3u and check 
a whole bunch of files at once.

Now to the Python part of the question.  It would seem an
easy enough proposition to write a program that would go
through the results and, given the above example, return:

Raw_Power.mp3: 7 samples clipped.

First obstacle is, mpg123 -t -c Raw_Power.mp3 > a_file
doesn't redirect this or any data to a_file.

Another approach to capturing the results?