1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
**********************
mp3Info
**********************
A small utility to read and write TAG info, as well as retrieve the MP3
Header info and print it all out in a nice format.
Features:
- Get, Set and Wipe MP3 TAG Info.
- Get MPEG Audio Version 1, 2 and 2.5 (All Layers) Header info.
- Userdefinable output formatting (rather advanced).
- Can rename files according to userdefined scheme.
- Can now also PLAY MP3s in a correct manner (Linux only).
Author is Thorvald Natvig <xeno@mix.hive.no>, if you in any way think this
is a nice program, send me an email saying "Hi". Feedback is nice.
I have only tested it on Linux/x86, but people have reported it to work on
a lot of other machines, and it should theoretically work on anything. I'm
interrested in having it compilable on other machines, so mail me any
problems you may have.
INSTALLATION INSTRUCTIONS:
If you're NOT on a Linux system, modify the Makefile and comment out all the
player stuff. The player will only work on Linux.
Just run the file 'INSTALL' to install it, should theoretically work just
fine.
Someday I'll learn how to do autoconfig and then it will be even finer.
If you change any of the source, please, Please send me a patch or the new
source so I can include it. Also send me a email if you use this utility :)
NEW VERSIONS:
New versions will be available on ftp://bimbo.hive.no/pub/mp3info/
They will also be uploaded to sunsite
MP3 PLAYING:
There are two methods of playing:
One is to use l3dec
(From Fraunhofer (http://www.iis.fhg.de/departs/amm/layer3/))
Just put it anywhere in your path.
The piper and audioplaying is done by the program
itself, at optimium speed :)
The other is to use splay (preferred, but much larger executable)
Get it from ftp://sunsite.unc.edu/pub/Linux/apps/sound/splay-0.6.tar.gz
This is the default method, as indicated in the Makefile.
Both versions can be forced to skip to the next song by sending the program
a HUP signal.
Very handy for putting the program in the background with a LARGE playlist.
I have included my playmp script, which I doubt will work on anything but
Linux system where you are root (just edit it and it will work anywhere).
What it does, is use locate to find all your MP3 tunes, and play them
all randomly. It goes with a shell alias:
alias mp='killall -HUP mp3info'
Just type 'mp' to skip to the next song.
*****************************
Output formatting magic
The output from the program can be 100% userdefines. There are two uses, one
is -f <format> to set the output format, and the other is -N <format> to set
a naming scheme. -N will RENAME the files specified according to the format.
The format is built up as a string, with the following special characters:
%% = %
%I = IF (explained below)
%! = Not-IF (also explained below)
%t = title of song
%a = Artist
%l = album
%y = year
%c = comment
%g = genre (text)
%# = genre (number)
%v = MPEG Version (1/2/2.5)
%V = MPEG Version as text
%L = Layer version (I, II, III)
%A = Layer version as number
%C = Error_Protection (0/1)
%b = Bitrate (in kbit/s)
%F = Sampling frequency
%M = mode
%O = Copyright (0/1)
%o = Original (0/1)
%m = length (minutes)
%s = length (remainding seconds.. Ie 3m 2s is "%mm %ss")
%S = length (ALL in seconds).
%N = Newline
%f = Filename (as specified on command line)
%i = Size of file (in bytes)
If cases:
If-cases are %I<WHAT>..
%IT If TAG info present
%IH If HEADER info present
%Ia If Artist info present
%It If Title of song present
%Il If album name present
%Iy If year present
%Ic If comment present
%IC If CRC.
%IO If Copyrighted.
%Io If Original
%IS If Stereo
%IE End-IF.
%! and the same characters means If NOT. So %!T means IF NOT TAG.
%!E is ELSE.
Example..
%IT Tag info present%IE %IHHeader info present %ICwith CRC%IE%IE
should explain it.
As seen, if's can be nested.
There is a length limit on the formatting string and the output which can be
set in mp3tools.h
Hint:
Bash etc often has ! as a special char, meaning you can't use it on the
command line, you have to have it in a bash-script of sorts.
Naming: I use the following naming scheme :
mp3info -N "%IH%It%t.mp3%IE%IE"
Which calls the tune
Rhythm is a dancer.mp3
Which names the files as <song name>.mp3, which is how I like it.
As an alternative, you can use:
mp3info -N "%IH%It%Ia(%a)-%IE%t.mp3%IE%IE"
Which would produce
(Snap)-Rhythm is a dancer.mp3
as a name.
-------
CREDITS
-------
I got the info about the MPEG Headers from free software available to decode
MPEG2 streams.
ID3 format by NamkraD/DC (erick@marble.net)
http://www.marble.net/~erick/mpeg3.htm
The debian stuff was added by Clint Adams <schizo@simons-rock.edu>
And a big thanks to all those who sent me an email :)
|