ref: 814486a2149e672dd9dac281992f28800445cd19
parent: 8e314324f52663f99dec31f4194aa97d8324170d
author: robs <robs>
date: Mon Mar 23 05:19:03 EDT 2009
doc recent changes
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,9 @@
LibSoX interface changes:
+ o sox_format_init() has been supeseded by sox_init().
+ o Removed obsolete error codes (SOX_E...); new sox_strerror()
+ function to convert error codes to text.
o Use of sox_effect_options() is now mandatory when initialising an
effect (see example0.c for an example of this).
o sox_flow_effects() has a new (3rd) parameter: a void pointer
@@ -83,6 +86,8 @@
o New `pluck' and `tpdf' types for `synth'. (robs)
o Can now set common parameters for multiple `synth' channels. (robs)
o Richer gain/normalise options. (robs)
+ o [2704442] Slight change to `riaa' gain: now norm'd to 0dB @ 1k
+ (previously 19.9dB @ DC). (Glenn Davis)
o Fix [2487589] `dither' clipping detection & handling. (robs)
o Fix `repeat' sometimes stopping repeating too soon. (robs)
o Fix `repeat' sometimes repeating wrong audio segments. (robs)
--- a/FEATURES.in
+++ b/FEATURES.in
@@ -85,6 +85,7 @@
** vol: Adjust audio volume
* Editting effects
+** crop: Like `trim', but can crop end without specifying length
** pad: Pad (usually) the ends of the audio with silence
** silence: Remove portions of silence from the audio
** splice: Perform the equivalent of a crossfaded tape splice
@@ -103,7 +104,7 @@
** tempo: Adjust tempo without changing pitch (WSOLA alg.)
* Mastering effects
-** dither: Add dither noise to increase SNR of <= 16-bit audio
+** dither: Add dither noise to increase quantisation SNR
** rate: Change audio sampling rate
* Specialised filters/mixers
@@ -117,6 +118,7 @@
** noiseprof: Produce a DFT profile of the audio (use with noisered)
** spectrogram+: graph signal level vs. frequency & time
** stat: Enumerate audio peak & rms levels, approx. freq., etc.
+** stats: Multichannel aware `stat'
+ optional effect, available only if SoX is built with `libpng'.
--- a/sox.1
+++ b/sox.1
@@ -1659,8 +1659,8 @@
are automatically enabled only when needed. The most likely use for
this is when applying fade in or out to an already dithered file, so
that the redithering applies only to the faded portions. However, auto
-dithering is not fool proof, so the fades should be carefully checked
-for any noise modulation; if this occurs, then either redither the whole
+dithering is not fool-proof, so the fades should be carefully checked
+for any noise modulation; if this occurs, then either re-dither the whole
file, or use
.BR trim ,
.BR fade ,
@@ -3072,18 +3072,13 @@
Mean delta \(S1/\s-2n\-1\s+2\^\(*S\^\^\(br\^\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR\^\(br\^
RMS delta \(sr(\(S1/\s-2n\-1\s+2\^\(*S\^(\fIx\s-2\dk\u\s0\fR\^\-\^\fIx\s-2\dk\-1\u\s0\fR)\(S2)
Rough frequency \ In Hz.
-Peak level (dBFS) 20\^log\s-2\d10\u\s0\^max(\(br\fIx\s-2\dk\u\s0\fR\(br) T{
-Taking the negative of this number and using it as the parameter to the
-.B gain
-effect will make the audio as loud as possible without clipping.
-Note: See the discussion on
-.B Clipping
-above for reasons why it might not be a good idea actually to do this.
-T}
Volume Adjustment \ T{
The parameter to the
.B vol
effect which would make the audio as loud as possible without clipping.
+Note: See the discussion on
+.B Clipping
+above for reasons why it is rarely a good idea actually to do this.
T}
.TE
.DT
--- a/src/adpcm.c
+++ b/src/adpcm.c
@@ -110,58 +110,55 @@
int n /* samples to decode PER channel */
)
{
- const unsigned char *ip;
- unsigned ch;
- const char *errmsg = NULL;
- MsState_t state[4]; /* One decompressor state for each channel */
+ const unsigned char *ip;
+ unsigned ch;
+ const char *errmsg = NULL;
+ MsState_t state[4]; /* One decompressor state for each channel */
- /* Read the four-byte header for each channel */
- ip = ibuff;
- for (ch = 0; ch < chans; ch++) {
- unsigned char bpred = *ip++;
- if (bpred >= nCoef) {
- errmsg = "MSADPCM bpred >= nCoef, arbitrarily using 0\n";
- bpred = 0;
- }
- state[ch].lsx_ms_adpcm_i_coef[0] = lsx_ms_adpcm_i_coef[(int)bpred*2+0];
- state[ch].lsx_ms_adpcm_i_coef[1] = lsx_ms_adpcm_i_coef[(int)bpred*2+1];
+ /* Read the four-byte header for each channel */
+ ip = ibuff;
+ for (ch = 0; ch < chans; ch++) {
+ unsigned char bpred = *ip++;
+ if (bpred >= nCoef) {
+ errmsg = "MSADPCM bpred >= nCoef, arbitrarily using 0\n";
+ bpred = 0;
+ }
+ state[ch].lsx_ms_adpcm_i_coef[0] = lsx_ms_adpcm_i_coef[(int)bpred*2+0];
+ state[ch].lsx_ms_adpcm_i_coef[1] = lsx_ms_adpcm_i_coef[(int)bpred*2+1];
+ }
- }
+ for (ch = 0; ch < chans; ch++)
+ lsbshortldi(state[ch].step, ip);
- for (ch = 0; ch < chans; ch++)
- lsbshortldi(state[ch].step, ip);
+ /* sample1's directly into obuff */
+ for (ch = 0; ch < chans; ch++)
+ lsbshortldi(obuff[chans+ch], ip);
- /* sample1's directly into obuff */
- for (ch = 0; ch < chans; ch++)
- lsbshortldi(obuff[chans+ch], ip);
+ /* sample2's directly into obuff */
+ for (ch = 0; ch < chans; ch++)
+ lsbshortldi(obuff[ch], ip);
- /* sample2's directly into obuff */
- for (ch = 0; ch < chans; ch++)
- lsbshortldi(obuff[ch], ip);
+ {
+ unsigned ch;
+ unsigned char b;
+ short *op, *top, *tmp;
- {
- unsigned ch;
- unsigned char b;
- short *op, *top, *tmp;
+ /* already have 1st 2 samples from block-header */
+ op = obuff + 2*chans;
+ top = obuff + n*chans;
- /* already have 1st 2 samples from block-header */
- op = obuff + 2*chans;
- top = obuff + n*chans;
-
- ch = 0;
- while (op < top) {
- b = *ip++;
- tmp = op;
- *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]);
- if (++ch == chans) ch = 0;
- /* ch = ++ch % chans; */
- tmp = op;
- *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]);
- if (++ch == chans) ch = 0;
- /* ch = ++ch % chans; */
- }
- }
- return errmsg;
+ ch = 0;
+ while (op < top) { /*** N.B. Without int casts, crashes on 64-bit arch ***/
+ b = *ip++;
+ tmp = op;
+ *op++ = AdpcmDecode(b >> 4, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]);
+ if (++ch == chans) ch = 0;
+ tmp = op;
+ *op++ = AdpcmDecode(b&0x0f, state+ch, tmp[-(int)chans], tmp[-(int)(2*chans)]);
+ if (++ch == chans) ch = 0;
+ }
+ }
+ return errmsg;
}
static int AdpcmMashS(
--- a/src/dft_filter.c
+++ b/src/dft_filter.c
@@ -1,4 +1,4 @@
-/* Effect: dft filter Copyright (c) 2008 robs@users.sourceforge.net
+/* Abstract effect: dft filter Copyright (c) 2008 robs@users.sourceforge.net
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
--- a/src/effects.h
+++ b/src/effects.h
@@ -28,7 +28,7 @@
EFFECT(dcshift)
EFFECT(deemph)
EFFECT(delay)
- EFFECT(dft_filter)
+ EFFECT(dft_filter) /* abstract */
EFFECT(dither)
EFFECT(earwax)
EFFECT(echo)