sox
コマンドではなく、soxi
を使います。
% soxi qiita.wav
Input File : './qiita.wav'
Channels : 1
Sample Rate : 16000
Precision : 16-bit
Duration : 00:03:15.35 = 5600 samples ~ 26.25 CDDA sectors
File Size : 11.2k
Bit Rate : 257k
Sample Encoding: 16-bit Signed Integer PCM
また、soxi
は様々なオプションがあります。そのまま引用すると、
Usage: soxi [-V[level]] [-T] [-t|-r|-c|-s|-d|-D|-b|-B|-p|-e|-a] infile1 ...
-V[n] Increment or set verbosity level (default is 2)
-T With -s, -d or -D, display the total across all given files
-t Show detected file-type
-r Show sample-rate
-c Show number of channels
-s Show number of samples (0 if unavailable)
-d Show duration in hours, minutes and seconds (0 if unavailable)
-D Show duration in seconds (0 if unavailable)
-b Show number of bits per sample (0 if not applicable)
-B Show the bitrate averaged over the whole file (0 if unavailable)
-p Show estimated sample precision in bits
-e Show the name of the audio encoding
-a Show file comments (annotations) if available
With no options, as much information as is available is shown for
each given file.
soxi
だけだと、全部の情報が出てきてしまうけれど、オプションをつけると欲しい分だけ情報が取れるといったところですね。