Getting information about an audio file

Purpose. Displays general information about an audio file: file type, format of audio data, length of audio data, total length of the file.

Usage. 

java AudioFileInfo [[ -f ] | [ -u ] | [ -s ]] [ -i ] [ -p ] [ audiofile ]

Parameters. 

-s

use standard input as source for the audio file. If this option is given, audiofile is not required.

-f

interpret audiofile as filename. If this option is given, audiofile is required.

-u

interpret audiofile as URL. If this option is given, audiofile is required.

-i

display information provided by AudioInputStream, too

-p

display AudioFormat and AudioFileFormat properties

audiofile

the file name or URL of the audio file that information should be displayed for. This is required if -s is not given.

Bugs, limitations. The latest version of this program requires Java 1.5. Some combination of options do not work. Both Sun's implementation and Tritonus show some information only with option -i.

Source code.  AudioFileInfo.java