A new `stats' effect has been written for SoX 14.3.0 (due out soon). Here's the manual entry -- will this meet your needs? (Unlike the soxi options, stats is primarily intended as human-readable rather than machine readable)
stats [-b bits|-x bits|-s scale] [-w window-time]
Display time domain statistical information about the audio
channels; audio is passed unmodified through the SoX processing
chain. For example, for a stereo file:
Overall Left Right
DC offset 0.000803 -0.000391 0.000803
Min level -0.750977 -0.750977 -0.653412
Max level 0.708801 0.708801 0.653534
Pk lev dB -2.49 -2.49 -3.69
RMS lev dB -19.41 -19.13 -19.71
RMS Pk dB -13.82 -13.82 -14.38
RMS Tr dB -85.25 -85.25 -82.66
Crest factor - 6.79 6.32
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 16/16 16/16 16/16
Num samples 7.72M
Length s 174.973
Scale max 1.000000
Window s 0.050
Statistics are calculated and displayed for each audio channel
and, where applicable, an overall figure is also given.
DC offset, Min level, and Max level are shown, by default, nor
malised to 1. If the -b (bits) options is given, then these
three measurements will be scaled to a signed integer with the
given number of bits; for example, for 16 bits, the scale would
be -32768 to +32767. The -x option behaves the same way as -b
except that the signed integer values are displayed in hexadeci
mal. The -s option scales the three measurements by a given
floating-point number.
Pk lev dB and RMS lev dB are standard peak and RMS level mea
sured in dBFS. RMS Pk dB and RMS Tr dB are peak and trough val
ues for RMS level measured over a short window (default 50ms).
Crest factor is the standard ratio of peak to RMS level (note:
not in dB).
Flat factor is a measure of the flatness (i.e. consecutive sam
ples with the same value) of the signal at its peak levels (i.e.
either Min level, or Max level). Pk count is the number of
occasions (not the number of samples) that the signal attained
either Min level, or Max level.
The right-hand Bit-depth figure is the standard definition of
bit-depth i.e. bits less significant than the given number are
fixed at zero. The left-hand figure is the number of most sig
nificant bits that are fixed at zero (or one for negative num
bers) subtracted from the right-hand figure (the number sub
tracted is directly related to Pk lev dB).
For multi-channel audio, an overall figure for each of the above
measurements is given and derived from the channel figures as
follows: DC offset: maximum magnitude; Max level, Pk lev dB,
RMS Pk dB, Bit-depth: maximum; Min level, RMS Tr dB: minimum;
RMS lev dB, Flat factor, Pk count: average; Crest factor: not
applicable.
Length s is the duration in seconds of the audio, and Num sam_
ples is equal to the sample-rate multiplied by Length.
Scale Max is the scaling applied to the first three measure
ments; specifically, it is the maximum value that could apply to
Max level. Window s is the length of the window used for the
peak and trough RMS measurements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A new `stats' effect has been written for SoX 14.3.0 (due out soon). Here's the manual entry -- will this meet your needs? (Unlike the soxi options, stats is primarily intended as human-readable rather than machine readable)
stats [-b bits|-x bits|-s scale] [-w window-time]
Display time domain statistical information about the audio
channels; audio is passed unmodified through the SoX processing
chain. For example, for a stereo file:
Overall Left Right
DC offset 0.000803 -0.000391 0.000803
Min level -0.750977 -0.750977 -0.653412
Max level 0.708801 0.708801 0.653534
Pk lev dB -2.49 -2.49 -3.69
RMS lev dB -19.41 -19.13 -19.71
RMS Pk dB -13.82 -13.82 -14.38
RMS Tr dB -85.25 -85.25 -82.66
Crest factor - 6.79 6.32
Flat factor 0.00 0.00 0.00
Pk count 2 2 2
Bit-depth 16/16 16/16 16/16
Num samples 7.72M
Length s 174.973
Scale max 1.000000
Window s 0.050
Statistics are calculated and displayed for each audio channel
and, where applicable, an overall figure is also given.
DC offset, Min level, and Max level are shown, by default, nor
malised to 1. If the -b (bits) options is given, then these
three measurements will be scaled to a signed integer with the
given number of bits; for example, for 16 bits, the scale would
be -32768 to +32767. The -x option behaves the same way as -b
except that the signed integer values are displayed in hexadeci
mal. The -s option scales the three measurements by a given
floating-point number.
Pk lev dB and RMS lev dB are standard peak and RMS level mea
sured in dBFS. RMS Pk dB and RMS Tr dB are peak and trough val
ues for RMS level measured over a short window (default 50ms).
Crest factor is the standard ratio of peak to RMS level (note:
not in dB).
Flat factor is a measure of the flatness (i.e. consecutive sam
ples with the same value) of the signal at its peak levels (i.e.
either Min level, or Max level). Pk count is the number of
occasions (not the number of samples) that the signal attained
either Min level, or Max level.
The right-hand Bit-depth figure is the standard definition of
bit-depth i.e. bits less significant than the given number are
fixed at zero. The left-hand figure is the number of most sig
nificant bits that are fixed at zero (or one for negative num
bers) subtracted from the right-hand figure (the number sub
tracted is directly related to Pk lev dB).
For multi-channel audio, an overall figure for each of the above
measurements is given and derived from the channel figures as
follows: DC offset: maximum magnitude; Max level, Pk lev dB,
RMS Pk dB, Bit-depth: maximum; Min level, RMS Tr dB: minimum;
RMS lev dB, Flat factor, Pk count: average; Crest factor: not
applicable.
Length s is the duration in seconds of the audio, and Num sam_
ples is equal to the sample-rate multiplied by Length.
Scale Max is the scaling applied to the first three measure
ments; specifically, it is the maximum value that could apply to
Max level. Window s is the length of the window used for the
peak and trough RMS measurements.
Outstanding!
I'll capture stderr output and parse whatever I need.
Thanks you very much for adding this impressive functionality, your efforts are greatly appreciated!!
-A440Hz
Released in 14.3.0
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).