ref: 24dba6cb64a66993110f5ff232eaf54cf8ec6b82
parent: 044d22262482cd9636ad09c2f3183ffe4704cfc2
author: robs <robs>
date: Sat Oct 27 11:29:54 EDT 2007
unsigned sox_sample_t doesn't exist; changing sox_ssample_t back to sox_sample_t
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -193,7 +193,7 @@
/*======================================================================*/
/* 8SVXREAD */
/*======================================================================*/
-static sox_size_t sox_svxread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_svxread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp)
{
unsigned char datum;
size_t done = 0, i;
@@ -261,7 +261,7 @@
/* 8SVXWRITE */
/*======================================================================*/
-static sox_size_t sox_svxwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_svxwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
svx_t p = (svx_t ) ft->priv;
--- a/src/adpcm.c
+++ b/src/adpcm.c
@@ -39,7 +39,7 @@
#include "adpcm.h"
typedef struct MsState {
- sox_ssample_t step; /* step size */
+ sox_sample_t step; /* step size */
short iCoef[2];
} MsState_t;
@@ -53,7 +53,7 @@
* 1.0 is scaled to 0x100
*/
static const
-sox_ssample_t stepAdjustTable[] = {
+sox_sample_t stepAdjustTable[] = {
230, 230, 230, 230, 307, 409, 512, 614,
768, 614, 512, 409, 307, 230, 230, 230
};
@@ -72,17 +72,17 @@
{ 392,-232}
};
-static inline sox_ssample_t AdpcmDecode(sox_ssample_t c, MsState_t *state,
- sox_ssample_t sample1, sox_ssample_t sample2)
+static inline sox_sample_t AdpcmDecode(sox_sample_t c, MsState_t *state,
+ sox_sample_t sample1, sox_sample_t sample2)
{
- sox_ssample_t vlin;
- sox_ssample_t sample;
- sox_ssample_t step;
+ sox_sample_t vlin;
+ sox_sample_t sample;
+ sox_sample_t step;
/** Compute next step value **/
step = state->step;
{
- sox_ssample_t nstep;
+ sox_sample_t nstep;
nstep = (stepAdjustTable[c] * step) >> 8;
state->step = (nstep < 16)? 16:nstep;
}
--- a/src/adpcms.c
+++ b/src/adpcms.c
@@ -167,7 +167,7 @@
* Notes :
******************************************************************************/
-sox_size_t sox_adpcm_read(sox_format_t * ft, adpcm_io_t state, sox_ssample_t * buffer, sox_size_t len)
+sox_size_t sox_adpcm_read(sox_format_t * ft, adpcm_io_t state, sox_sample_t * buffer, sox_size_t len)
{
sox_size_t n;
uint8_t byte;
@@ -216,7 +216,7 @@
* Notes :
******************************************************************************/
-sox_size_t sox_adpcm_write(sox_format_t * ft, adpcm_io_t state, const sox_ssample_t * buffer, sox_size_t length)
+sox_size_t sox_adpcm_write(sox_format_t * ft, adpcm_io_t state, const sox_sample_t * buffer, sox_size_t length)
{
sox_size_t count = 0;
uint8_t byte = state->store.byte;
--- a/src/adpcms.h
+++ b/src/adpcms.h
@@ -39,8 +39,8 @@
void sox_adpcm_reset(adpcm_io_t state, sox_encoding_t type);
int sox_adpcm_oki_start(sox_format_t * ft, adpcm_io_t state);
int sox_adpcm_ima_start(sox_format_t * ft, adpcm_io_t state);
-sox_size_t sox_adpcm_read(sox_format_t * ft, adpcm_io_t state, sox_ssample_t *buffer, sox_size_t len);
+sox_size_t sox_adpcm_read(sox_format_t * ft, adpcm_io_t state, sox_sample_t *buffer, sox_size_t len);
int sox_adpcm_stopread(sox_format_t * ft, adpcm_io_t state);
-sox_size_t sox_adpcm_write(sox_format_t * ft, adpcm_io_t state, const sox_ssample_t *buffer, sox_size_t length);
+sox_size_t sox_adpcm_write(sox_format_t * ft, adpcm_io_t state, const sox_sample_t *buffer, sox_size_t length);
void sox_adpcm_flush(sox_format_t * ft, adpcm_io_t state);
int sox_adpcm_stopwrite(sox_format_t * ft, adpcm_io_t state);
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -604,7 +604,7 @@
return(SOX_SUCCESS);
}
-sox_size_t sox_aiffread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+sox_size_t sox_aiffread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
aiff_t aiff = (aiff_t ) ft->priv;
sox_ssize_t done;
@@ -691,7 +691,7 @@
return(aiffwriteheader(ft, 0x7f000000 / (ft->signal.size*ft->signal.channels)));
}
-sox_size_t sox_aiffwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+sox_size_t sox_aiffwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
aiff_t aiff = (aiff_t ) ft->priv;
aiff->nsamples += len;
@@ -708,7 +708,7 @@
NUL */
if (aiff->nsamples % 2 == 1 && ft->signal.size == 1 && ft->signal.channels == 1)
{
- sox_ssample_t buf = 0;
+ sox_sample_t buf = 0;
sox_rawwrite(ft, &buf, 1);
}
@@ -912,7 +912,7 @@
NUL */
if (aiff->nsamples % 2 == 1 && ft->signal.size == 1 && ft->signal.channels == 1)
{
- sox_ssample_t buf = 0;
+ sox_sample_t buf = 0;
sox_rawwrite(ft, &buf, 1);
}
--- a/src/aiff.h
+++ b/src/aiff.h
@@ -17,10 +17,10 @@
int sox_aiffseek(sox_format_t * ft, sox_size_t offset);
int sox_aiffstartread(sox_format_t * ft);
-sox_size_t sox_aiffread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len);
+sox_size_t sox_aiffread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len);
int sox_aiffstopread(sox_format_t * ft);
int sox_aiffstartwrite(sox_format_t * ft);
-sox_size_t sox_aiffwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len);
+sox_size_t sox_aiffwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len);
int sox_aiffstopwrite(sox_format_t * ft);
int sox_aifcstartwrite(sox_format_t * ft);
int sox_aifcstopwrite(sox_format_t * ft);
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -426,19 +426,19 @@
return sox_alsasetup(ft, SND_PCM_STREAM_CAPTURE);
}
-static void ub_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
+static void ub_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
{
while (len--)
*buf1++ = SOX_UNSIGNED_8BIT_TO_SAMPLE(*((unsigned char *)buf2++),);
}
-static void sb_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
+static void sb_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips UNUSED)
{
while (len--)
*buf1++ = SOX_SIGNED_8BIT_TO_SAMPLE(*((int8_t *)buf2++),);
}
-static void uw_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
+static void uw_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
{
while (len--)
{
@@ -451,7 +451,7 @@
}
}
-static void sw_read_buf(sox_ssample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
+static void sw_read_buf(sox_sample_t *buf1, char const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips UNUSED)
{
while (len--)
{
@@ -464,10 +464,10 @@
}
}
-static sox_size_t sox_alsaread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_alsaread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp)
{
alsa_priv_t alsa = (alsa_priv_t)ft->priv;
- void (*read_buf)(sox_ssample_t *, char const *, sox_size_t, sox_bool, sox_size_t *) = 0;
+ void (*read_buf)(sox_sample_t *, char const *, sox_size_t, sox_bool, sox_size_t *) = 0;
sox_size_t len;
switch(ft->signal.size) {
@@ -532,19 +532,19 @@
return sox_alsasetup(ft, SND_PCM_STREAM_PLAYBACK);
}
-static void sox_ub_write_buf(char* buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
+static void sox_ub_write_buf(char* buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
{
while (len--)
*(uint8_t *)buf1++ = SOX_SAMPLE_TO_UNSIGNED_8BIT(*buf2++, *clips);
}
-static void sox_sb_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
+static void sox_sb_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap UNUSED, sox_size_t * clips)
{
while (len--)
*(int8_t *)buf1++ = SOX_SAMPLE_TO_SIGNED_8BIT(*buf2++, *clips);
}
-static void sox_uw_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
+static void sox_uw_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
{
while (len--)
{
@@ -556,7 +556,7 @@
}
}
-static void sox_sw_write_buf(char *buf1, sox_ssample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
+static void sox_sw_write_buf(char *buf1, sox_sample_t const * buf2, sox_size_t len, sox_bool swap, sox_size_t * clips)
{
while (len--)
{
@@ -568,11 +568,11 @@
}
}
-static sox_size_t sox_alsawrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_alsawrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp)
{
sox_size_t osamp, done;
alsa_priv_t alsa = (alsa_priv_t)ft->priv;
- void (*write_buf)(char *, const sox_ssample_t *, sox_size_t, sox_bool, sox_size_t *) = 0;
+ void (*write_buf)(char *, const sox_sample_t *, sox_size_t, sox_bool, sox_size_t *) = 0;
switch(ft->signal.size) {
case SOX_SIZE_BYTE:
--- a/src/amr.h
+++ b/src/amr.h
@@ -79,7 +79,7 @@
return SOX_SUCCESS;
}
-static sox_size_t read(sox_format_t * ft, sox_ssample_t * buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t * buf, sox_size_t len)
{
amr_t amr = (amr_t) ft->priv;
sox_size_t done;
@@ -121,7 +121,7 @@
return SOX_SUCCESS;
}
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t * buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t * buf, sox_size_t len)
{
amr_t amr = (amr_t) ft->priv;
sox_size_t done;
--- a/src/ao.c
+++ b/src/ao.c
@@ -58,11 +58,11 @@
return SOX_SUCCESS;
}
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
ao_priv_t ao = (ao_priv_t)ft->priv;
- if (ao_play(ao->device, (void *)buf, len * sizeof(sox_ssample_t)) == 0)
+ if (ao_play(ao->device, (void *)buf, len * sizeof(sox_sample_t)) == 0)
return 0;
return len;
--- a/src/au.c
+++ b/src/au.c
@@ -331,7 +331,7 @@
return (p->in_bits > 0);
}
-static sox_size_t sox_auread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_auread(sox_format_t * ft, sox_sample_t *buf, sox_size_t samp)
{
au_t p = (au_t ) ft->priv;
unsigned char code;
@@ -349,7 +349,7 @@
return done;
}
-static sox_size_t sox_auwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_auwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t samp)
{
au_t p = (au_t ) ft->priv;
p->data_size += samp * ft->signal.size;
--- a/src/avr.c
+++ b/src/avr.c
@@ -246,7 +246,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_avrwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_avrwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp)
{
avr_t avr = (avr_t)ft->priv;
--- a/src/biquad.c
+++ b/src/biquad.c
@@ -58,11 +58,11 @@
biquad_t p = (biquad_t) effp->priv;
/* Simplify: */
- p->b2 = p->b2/p->a0;
- p->b1 = p->b1/p->a0;
- p->b0 = p->b0/p->a0;
- p->a2 = p->a2/p->a0;
- p->a1 = p->a1/p->a0;
+ p->b2 /= p->a0;
+ p->b1 /= p->a0;
+ p->b0 /= p->a0;
+ p->a2 /= p->a0;
+ p->a1 /= p->a0;
if (effp->global_info->plot == sox_plot_octave) {
printf(
@@ -111,8 +111,8 @@
}
-int sox_biquad_flow(sox_effect_t * effp, const sox_ssample_t *ibuf,
- sox_ssample_t *obuf, sox_size_t *isamp, sox_size_t *osamp)
+int sox_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf,
+ sox_sample_t *obuf, sox_size_t *isamp, sox_size_t *osamp)
{
biquad_t p = (biquad_t) effp->priv;
sox_size_t len = min(*isamp, *osamp);
--- a/src/biquad.h
+++ b/src/biquad.h
@@ -66,7 +66,7 @@
double b2, b1, b0; /* Filter coefficients */
double a2, a1, a0; /* Filter coefficients */
- sox_ssample_t i1, i2; /* Filter memory */
+ sox_sample_t i1, i2; /* Filter memory */
double o1, o2; /* Filter memory */
} * biquad_t;
@@ -78,7 +78,7 @@
int min_args, int max_args, int fc_pos, int width_pos, int gain_pos,
char const * allowed_width_types, filter_t filter_type);
int sox_biquad_start(sox_effect_t * effp);
-int sox_biquad_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+int sox_biquad_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp);
#undef sox_fail
--- a/src/cdr.c
+++ b/src/cdr.c
@@ -71,7 +71,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_cdrread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_cdrread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
return sox_rawread(ft, buf, len);
@@ -107,7 +107,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_cdrwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_cdrwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
cdr_t cdr = (cdr_t) ft->priv;
--- a/src/chorus.c
+++ b/src/chorus.c
@@ -235,13 +235,13 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_chorus_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_chorus_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
chorus_t chorus = (chorus_t) effp->priv;
int i;
float d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
sox_size_t len = min(*isamp, *osamp);
*isamp = *osamp = len;
@@ -256,7 +256,7 @@
chorus->maxsamples] * chorus->decay[i];
/* Adjust the output volume and size to 24 bit */
d_out = d_out * chorus->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
chorus->chorusbuf[chorus->counter] = d_in;
@@ -273,7 +273,7 @@
/*
* Drain out reverb lines.
*/
-static int sox_chorus_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_chorus_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
chorus_t chorus = (chorus_t) effp->priv;
sox_size_t done;
@@ -280,7 +280,7 @@
int i;
float d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
done = 0;
while ( ( done < *osamp ) && ( done < chorus->fade_out ) ) {
@@ -293,7 +293,7 @@
chorus->maxsamples] * chorus->decay[i];
/* Adjust the output volume and size to 24 bit */
d_out = d_out * chorus->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
chorus->chorusbuf[chorus->counter] = d_in;
--- a/src/compand.c
+++ b/src/compand.c
@@ -52,7 +52,7 @@
unsigned expectedChannels;/* Also flags that channels aren't to be treated
individually when = 1 and input not mono */
double delay; /* Delay to apply before companding */
- sox_ssample_t *delay_buf; /* Old samples, used for delay processing */
+ sox_sample_t *delay_buf; /* Old samples, used for delay processing */
sox_ssize_t delay_buf_size;/* Size of delay_buf in samples */
sox_ssize_t delay_buf_index; /* Index into delay_buf */
sox_ssize_t delay_buf_cnt; /* No. of active entries in delay_buf */
@@ -172,7 +172,7 @@
*v += delta * l->channels[chan].attack_times[1];
}
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
compand_t l = (compand_t) effp->priv;
@@ -233,7 +233,7 @@
return (SOX_SUCCESS);
}
-static int drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
compand_t l = (compand_t) effp->priv;
sox_size_t chan, done = 0;
--- a/src/cvsd.c
+++ b/src/cvsd.c
@@ -227,7 +227,7 @@
/* ---------------------------------------------------------------------- */
-sox_size_t sox_cvsdread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp)
+sox_size_t sox_cvsdread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp)
{
struct cvsdpriv *p = (struct cvsdpriv *) ft->priv;
sox_size_t done = 0;
@@ -283,7 +283,7 @@
/* ---------------------------------------------------------------------- */
-sox_size_t sox_cvsdwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp)
+sox_size_t sox_cvsdwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp)
{
struct cvsdpriv *p = (struct cvsdpriv *) ft->priv;
sox_size_t done = 0;
--- a/src/cvsd.h
+++ b/src/cvsd.h
@@ -23,8 +23,8 @@
int sox_cvsdstartread(sox_format_t * ft);
int sox_cvsdstartwrite(sox_format_t * ft);
-sox_size_t sox_cvsdread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp);
-sox_size_t sox_cvsdwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp);
+sox_size_t sox_cvsdread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp);
+sox_size_t sox_cvsdwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp);
int sox_cvsdstopread(sox_format_t * ft);
int sox_cvsdstopwrite(sox_format_t * ft);
--- a/src/dat.c
+++ b/src/dat.c
@@ -76,7 +76,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_datread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_datread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp)
{
char inpstr[LINEWIDTH];
int inpPtr = 0;
@@ -123,7 +123,7 @@
return (done);
}
-static sox_size_t sox_datwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp)
+static sox_size_t sox_datwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp)
{
dat_t dat = (dat_t) ft->priv;
sox_size_t done = 0;
--- a/src/dcshift.c
+++ b/src/dcshift.c
@@ -78,7 +78,7 @@
/*
* Process data.
*/
-static int sox_dcshift_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_dcshift_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
dcs_t dcs = (dcs_t) effp->priv;
--- a/src/dither.c
+++ b/src/dither.c
@@ -61,8 +61,8 @@
return SOX_EFF_NULL; /* Dithering not needed at >= 24 bits */
}
-static int flow(sox_effect_t * effp, const sox_ssample_t * ibuf,
- sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int flow(sox_effect_t * effp, const sox_sample_t * ibuf,
+ sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
dither_t dither = (dither_t)effp->priv;
sox_size_t len = min(*isamp, *osamp);
--- a/src/earwax.c
+++ b/src/earwax.c
@@ -29,7 +29,7 @@
/* A stereo fir filter. One side filters as if the signal was from
30 degrees from the ear, the other as if 330 degrees. */
/* 30 330 */
-static const sox_ssample_t filt[] =
+static const sox_sample_t filt[] =
{ 4, -6,
4, -11,
-1, -5,
@@ -67,7 +67,7 @@
#define EARWAX_NUMTAPS 64
typedef struct earwaxstuff {
- sox_ssample_t *tap; /* taps are z^-1 delays for the FIR filter */
+ sox_sample_t *tap; /* taps are z^-1 delays for the FIR filter */
} *earwax_t;
/*
@@ -85,7 +85,7 @@
}
/* allocate tap memory */
- earwax->tap = (sox_ssample_t*)xmalloc( sizeof(sox_ssample_t) * EARWAX_NUMTAPS );
+ earwax->tap = (sox_sample_t*)xmalloc( sizeof(sox_sample_t) * EARWAX_NUMTAPS );
/* zero out the delayed taps */
for(i=0; i < EARWAX_NUMTAPS; i++ ){
@@ -100,13 +100,13 @@
* Return number of samples processed.
*/
-static int sox_earwax_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_earwax_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
earwax_t earwax = (earwax_t) effp->priv;
int len, done;
int i;
- sox_ssample_t output;
+ sox_sample_t output;
len = ((*isamp > *osamp) ? *osamp : *isamp);
@@ -132,11 +132,11 @@
/*
* Drain out taps.
*/
-static int sox_earwax_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_earwax_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
earwax_t earwax = (earwax_t) effp->priv;
int i,j;
- sox_ssample_t output;
+ sox_sample_t output;
for(i = EARWAX_NUMTAPS-1; i >= 0; i--){
output = 0;
--- a/src/echo.c
+++ b/src/echo.c
@@ -175,13 +175,13 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_echo_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_echo_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
echo_t echo = (echo_t) effp->priv;
int j;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
sox_size_t len = min(*isamp, *osamp);
*isamp = *osamp = len;
@@ -197,7 +197,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echo->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Store input in delay buffer */
echo->delay_buf[echo->counter] = d_in;
@@ -211,11 +211,11 @@
/*
* Drain out reverb lines.
*/
-static int sox_echo_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_echo_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
echo_t echo = (echo_t) effp->priv;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
int j;
sox_size_t done;
@@ -231,7 +231,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echo->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Store input in delay buffer */
echo->delay_buf[echo->counter] = d_in;
--- a/src/echos.c
+++ b/src/echos.c
@@ -167,13 +167,13 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_echos_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_echos_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
echos_t echos = (echos_t) effp->priv;
int j;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
sox_size_t len = min(*isamp, *osamp);
*isamp = *osamp = len;
@@ -187,7 +187,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echos->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delays and input */
for ( j = 0; j < echos->num_delays; j++ ) {
@@ -209,11 +209,11 @@
/*
* Drain out reverb lines.
*/
-static int sox_echos_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_echos_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
echos_t echos = (echos_t) effp->priv;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
int j;
sox_size_t done;
@@ -227,7 +227,7 @@
}
/* Adjust the output volume and size to 24 bit */
d_out = d_out * echos->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delays and input */
for ( j = 0; j < echos->num_delays; j++ ) {
--- a/src/effects.c
+++ b/src/effects.c
@@ -53,7 +53,7 @@
}
/* Pass through samples verbatim */
-static int default_flow(sox_effect_t * effp UNUSED, const sox_ssample_t *ibuf UNUSED, sox_ssample_t *obuf UNUSED, sox_size_t *isamp, sox_size_t *osamp)
+static int default_flow(sox_effect_t * effp UNUSED, const sox_sample_t *ibuf UNUSED, sox_sample_t *obuf UNUSED, sox_size_t *isamp, sox_size_t *osamp)
{
*isamp = *osamp = min(*isamp, *osamp);
memcpy(obuf, ibuf, *isamp * sizeof(*obuf));
@@ -61,7 +61,7 @@
}
/* Inform no more samples to drain */
-static int default_drain(sox_effect_t * effp UNUSED, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
+static int default_drain(sox_effect_t * effp UNUSED, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
{
*osamp = 0;
return SOX_EOF;
@@ -171,7 +171,7 @@
sox_effect_t * effp = &chain->effects[n][0];
int effstatus = SOX_SUCCESS;
sox_size_t i, f;
- const sox_ssample_t *ibuf;
+ const sox_sample_t *ibuf;
sox_size_t idone = effp1->oend - effp1->obeg;
sox_size_t obeg = sox_globals.bufsiz - effp->oend;
#if DEBUG_EFFECTS_CHAIN
@@ -183,7 +183,7 @@
effstatus = effp->handler.flow(effp, &effp1->obuf[effp1->obeg],
&effp->obuf[effp->oend], &idone, &obeg);
else { /* Run effect on each channel individually */
- sox_ssample_t *obuf = &effp->obuf[effp->oend];
+ sox_sample_t *obuf = &effp->obuf[effp->oend];
sox_size_t idone_last, odone_last;
ibuf = &effp1->obuf[effp1->obeg];
@@ -245,7 +245,7 @@
if (effp->flows == 1) /* Run effect on all channels at once */
effstatus = effp->handler.drain(effp, &effp->obuf[effp->oend], &obeg);
else { /* Run effect on each channel individually */
- sox_ssample_t *obuf = &effp->obuf[effp->oend];
+ sox_sample_t *obuf = &effp->obuf[effp->oend];
sox_size_t odone_last;
for (f = 0; f < effp->flows; ++f) {
--- a/src/fade.c
+++ b/src/fade.c
@@ -176,13 +176,13 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_fade_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_fade_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
fade_t fade = (fade_t) effp->priv;
/* len is total samples, chcnt counts channels */
int len = 0, t_output = 1, more_output = 1;
- sox_ssample_t t_ibuf;
+ sox_sample_t t_ibuf;
sox_size_t chcnt = 0;
len = ((*isamp > *osamp) ? *osamp : *isamp);
@@ -257,7 +257,7 @@
/*
* Drain out remaining samples if the effect generates any.
*/
-static int sox_fade_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_fade_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
fade_t fade = (fade_t) effp->priv;
int len;
--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -212,7 +212,7 @@
* Read up to len samples of type sox_sample_t from file into buf[].
* Return number of samples read.
*/
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
ffmpeg_t ffmpeg = (ffmpeg_t)ft->priv;
AVPacket *pkt = &ffmpeg->audio_pkt;
@@ -397,7 +397,7 @@
* Write up to len samples of type sox_sample_t from buf[] into file.
* Return number of samples written.
*/
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
ffmpeg_t ffmpeg = (ffmpeg_t)ft->priv;
sox_size_t nread = 0, nwritten = 0;
--- a/src/filter.c
+++ b/src/filter.c
@@ -33,8 +33,8 @@
/* Private data for Lerp via LCM file */
typedef struct filterstuff {
sox_rate_t rate;
- sox_ssample_t freq0;/* low corner freq */
- sox_ssample_t freq1;/* high corner freq */
+ sox_sample_t freq0;/* low corner freq */
+ sox_sample_t freq1;/* high corner freq */
double beta;/* >2 is kaiser window beta, <=2 selects nuttall window */
long Nwin;
double *Fp;/* [Xh+1] Filter coefficients */
@@ -103,7 +103,7 @@
f->rate = effp->ininfo.rate;
/* adjust upper frequency to Nyquist if necessary */
- if (f->freq1 > (sox_ssample_t)f->rate/2 || f->freq1 <= 0)
+ if (f->freq1 > (sox_sample_t)f->rate/2 || f->freq1 <= 0)
f->freq1 = f->rate/2;
if ((f->freq0 < 0) || (f->freq0 > f->freq1))
@@ -115,7 +115,7 @@
Xh = f->Nwin/2;
Fp0 = (double *) xmalloc(sizeof(double) * (Xh + 2)) + 1;
- if (f->freq0 > (sox_ssample_t)f->rate/200) {
+ if (f->freq0 > (sox_sample_t)f->rate/200) {
Xh0 = makeFilter(Fp0, Xh, 2.0*(double)f->freq0/f->rate, f->beta, 1, 0);
if (Xh0 <= 1)
{
@@ -127,7 +127,7 @@
}
Fp1 = (double *) xmalloc(sizeof(double) * (Xh + 2)) + 1;
/* need Fp[-1] and Fp[Xh] for makeFilter */
- if (f->freq1 < (sox_ssample_t)f->rate/2) {
+ if (f->freq1 < (sox_sample_t)f->rate/2) {
Xh1 = makeFilter(Fp1, Xh, 2.0*(double)f->freq1/f->rate, f->beta, 1, 0);
if (Xh1 <= 1)
{
@@ -171,7 +171,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_filter_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_filter_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
filter_t f = (filter_t) effp->priv;
@@ -224,11 +224,11 @@
/*
* Process tail of input samples.
*/
-static int sox_filter_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_filter_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
filter_t f = (filter_t) effp->priv;
long isamp_res, osamp_res;
- sox_ssample_t *Obuf;
+ sox_sample_t *Obuf;
sox_debug("Xh %d, Xt %d <--- DRAIN",f->Xh, f->Xt);
@@ -237,7 +237,7 @@
osamp_res = *osamp;
Obuf = obuf;
while (isamp_res>0 && osamp_res>0) {
- sox_ssample_t Isamp, Osamp;
+ sox_sample_t Isamp, Osamp;
Isamp = isamp_res;
Osamp = osamp_res;
sox_filter_flow(effp, NULL, Obuf, (sox_size_t *)&Isamp, (sox_size_t *)&Osamp);
--- a/src/flac.c
+++ b/src/flac.c
@@ -194,7 +194,7 @@
}
-static sox_size_t read(sox_format_t * const ft, sox_ssample_t * sampleBuffer, sox_size_t const requested)
+static sox_size_t read(sox_format_t * const ft, sox_sample_t * sampleBuffer, sox_size_t const requested)
{
Decoder * decoder = (Decoder *) ft->priv;
size_t actual = 0;
@@ -473,7 +473,7 @@
-static sox_size_t write(sox_format_t * const ft, sox_ssample_t const * const sampleBuffer, sox_size_t const len)
+static sox_size_t write(sox_format_t * const ft, sox_sample_t const * const sampleBuffer, sox_size_t const len)
{
Encoder * encoder = (Encoder *) ft->priv;
unsigned i;
--- a/src/flanger.c
+++ b/src/flanger.c
@@ -203,8 +203,8 @@
-static int sox_flanger_flow(sox_effect_t * effp, sox_ssample_t const * ibuf,
- sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int sox_flanger_flow(sox_effect_t * effp, sox_sample_t const * ibuf,
+ sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
flanger_t f = (flanger_t) effp->priv;
int c, channels = effp->ininfo.channels;
--- a/src/gsm.c
+++ b/src/gsm.c
@@ -105,7 +105,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_gsmread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_gsmread(sox_format_t * ft, sox_sample_t *buf, sox_size_t samp)
{
size_t done = 0, r;
int ch, chans;
@@ -184,7 +184,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_gsmwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_gsmwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t samp)
{
size_t done = 0;
struct gsmpriv *p = (struct gsmpriv *) ft->priv;
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -149,7 +149,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_hcomread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_hcomread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
register struct readpriv *p = (struct readpriv *) ft->priv;
int done = 0;
@@ -264,10 +264,10 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_hcomwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_hcomwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
struct writepriv *p = (struct writepriv *) ft->priv;
- sox_ssample_t datum;
+ sox_sample_t datum;
sox_size_t i;
if (len == 0)
--- a/src/ladspa.c
+++ b/src/ladspa.c
@@ -222,12 +222,11 @@
/*
* Process one bufferful of data.
*/
-static int sox_ladspa_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_ladspa_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
ladspa_t l_st = (ladspa_t)effp->priv;
- sox_sample_t i;
- sox_size_t len = min(*isamp, *osamp);
+ sox_size_t i, len = min(*isamp, *osamp);
*osamp = *isamp = len;
@@ -267,7 +266,7 @@
/*
* Nothing to do.
*/
-static int sox_ladspa_drain(sox_effect_t * effp UNUSED, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
+static int sox_ladspa_drain(sox_effect_t * effp UNUSED, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
{
*osamp = 0;
--- a/src/lpc10.c
+++ b/src/lpc10.c
@@ -146,7 +146,7 @@
return SOX_SUCCESS;
}
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
lpcpriv_t lpc = (lpcpriv_t)ft->priv;
sox_size_t nread = 0;
@@ -170,7 +170,7 @@
return nread;
}
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
lpcpriv_t lpc = (lpcpriv_t)ft->priv;
sox_size_t nwritten = 0;
--- a/src/maud.c
+++ b/src/maud.c
@@ -232,7 +232,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_maudwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_maudwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
struct maudstuff * p = (struct maudstuff *) ft->priv;
--- a/src/mcompand.c
+++ b/src/mcompand.c
@@ -123,7 +123,7 @@
return (SOX_SUCCESS);
}
-static int lowpass_flow(sox_effect_t * effp, butterworth_crossover_t butterworth, sox_size_t nChan, sox_ssample_t *ibuf, sox_ssample_t *lowbuf, sox_ssample_t *highbuf,
+static int lowpass_flow(sox_effect_t * effp, butterworth_crossover_t butterworth, sox_size_t nChan, sox_sample_t *ibuf, sox_sample_t *lowbuf, sox_sample_t *highbuf,
sox_size_t len) {
sox_size_t chan;
double in, out;
@@ -130,7 +130,7 @@
sox_size_t done;
- sox_ssample_t *ibufptr, *lowbufptr, *highbufptr;
+ sox_sample_t *ibufptr, *lowbufptr, *highbufptr;
for (chan=0;chan<nChan;++chan) {
ibufptr = ibuf+chan;
@@ -200,7 +200,7 @@
double delay; /* Delay to apply before companding */
double topfreq; /* upper bound crossover frequency */
struct butterworth_crossover filter;
- sox_ssample_t *delay_buf; /* Old samples, used for delay processing */
+ sox_sample_t *delay_buf; /* Old samples, used for delay processing */
sox_size_t delay_size; /* lookahead for this band (in samples) - function of delay, above */
sox_ssize_t delay_buf_ptr; /* Index into delay_buf */
sox_size_t delay_buf_cnt; /* No. of active entries in delay_buf */
@@ -208,7 +208,7 @@
typedef struct {
sox_size_t nBands;
- sox_ssample_t *band_buf1, *band_buf2, *band_buf3;
+ sox_sample_t *band_buf1, *band_buf2, *band_buf3;
sox_size_t band_buf_len;
sox_size_t delay_buf_size;/* Size of delay_buf in samples */
struct comp_band *bands;
@@ -381,7 +381,7 @@
/* Allocate the delay buffer */
if (c->delay_buf_size > 0)
- l->delay_buf = (sox_ssample_t *)xcalloc(sizeof(long), c->delay_buf_size);
+ l->delay_buf = (sox_sample_t *)xcalloc(sizeof(long), c->delay_buf_size);
l->delay_buf_ptr = 0;
l->delay_buf_cnt = 0;
@@ -398,7 +398,7 @@
static void doVolume(double *v, double samp, comp_band_t l, sox_size_t chan)
{
- double s = samp/(~((sox_ssample_t)1<<31));
+ double s = samp/(~((sox_sample_t)1<<31));
double delta = s - *v;
if (delta > 0.0) /* increase volume according to attack rate */
@@ -407,7 +407,7 @@
*v += delta * l->decayRate[chan];
}
-static int sox_mcompand_flow_1(sox_effect_t * effp, compand_t c, comp_band_t l, const sox_ssample_t *ibuf, sox_ssample_t *obuf, sox_size_t len, sox_size_t filechans)
+static int sox_mcompand_flow_1(sox_effect_t * effp, compand_t c, comp_band_t l, const sox_sample_t *ibuf, sox_sample_t *obuf, sox_size_t len, sox_size_t filechans)
{
sox_size_t done, chan;
@@ -477,24 +477,24 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp) {
compand_t c = (compand_t) effp->priv;
comp_band_t l;
sox_size_t len = min(*isamp, *osamp);
sox_size_t band, i;
- sox_ssample_t *abuf, *bbuf, *cbuf, *oldabuf, *ibuf_copy;
+ sox_sample_t *abuf, *bbuf, *cbuf, *oldabuf, *ibuf_copy;
double out;
if (c->band_buf_len < len) {
- c->band_buf1 = (sox_ssample_t *)xrealloc(c->band_buf1,len*sizeof(sox_ssample_t));
- c->band_buf2 = (sox_ssample_t *)xrealloc(c->band_buf2,len*sizeof(sox_ssample_t));
- c->band_buf3 = (sox_ssample_t *)xrealloc(c->band_buf3,len*sizeof(sox_ssample_t));
+ c->band_buf1 = (sox_sample_t *)xrealloc(c->band_buf1,len*sizeof(sox_sample_t));
+ c->band_buf2 = (sox_sample_t *)xrealloc(c->band_buf2,len*sizeof(sox_sample_t));
+ c->band_buf3 = (sox_sample_t *)xrealloc(c->band_buf3,len*sizeof(sox_sample_t));
c->band_buf_len = len;
}
- ibuf_copy = (sox_ssample_t *)xmalloc(*isamp * sizeof(sox_ssample_t));
- memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_ssample_t));
+ ibuf_copy = (sox_sample_t *)xmalloc(*isamp * sizeof(sox_sample_t));
+ memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_sample_t));
/* split ibuf into bands using butterworths, pipe each band through sox_mcompand_flow_1, then add back together and write to obuf */
@@ -529,7 +529,7 @@
return SOX_SUCCESS;
}
-static int sox_mcompand_drain_1(sox_effect_t * effp, compand_t c, comp_band_t l, sox_ssample_t *obuf, sox_size_t maxdrain)
+static int sox_mcompand_drain_1(sox_effect_t * effp, compand_t c, comp_band_t l, sox_sample_t *obuf, sox_size_t maxdrain)
{
sox_size_t done;
double out;
@@ -553,7 +553,7 @@
/*
* Drain out compander delay lines.
*/
-static int drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
sox_size_t band, drained, mostdrained = 0;
compand_t c = (compand_t)effp->priv;
--- a/src/misc.c
+++ b/src/misc.c
@@ -309,12 +309,12 @@
/* dummy format routines for do-nothing functions */
int sox_format_nothing(sox_format_t * ft UNUSED) { return(SOX_SUCCESS); }
-sox_size_t sox_format_nothing_read(sox_format_t * ft UNUSED, sox_ssample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
-sox_size_t sox_format_nothing_write(sox_format_t * ft UNUSED, const sox_ssample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
+sox_size_t sox_format_nothing_read(sox_format_t * ft UNUSED, sox_sample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
+sox_size_t sox_format_nothing_write(sox_format_t * ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t len UNUSED) { return(0); }
int sox_format_nothing_seek(sox_format_t * ft UNUSED, sox_size_t offset UNUSED) { sox_fail_errno(ft, SOX_ENOTSUP, "operation not supported"); return(SOX_EOF); }
/* here for linear interp. might be useful for other things */
-sox_ssample_t sox_gcd(sox_ssample_t a, sox_ssample_t b)
+sox_sample_t sox_gcd(sox_sample_t a, sox_sample_t b)
{
if (b == 0)
return a;
@@ -322,7 +322,7 @@
return sox_gcd(b, a % b);
}
-sox_ssample_t sox_lcm(sox_ssample_t a, sox_ssample_t b)
+sox_sample_t sox_lcm(sox_sample_t a, sox_sample_t b)
{
/* parenthesize this way to avoid sox_sample_t overflow in product term */
return a * (b / sox_gcd(a, b));
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -500,7 +500,7 @@
* Process either isamp or osamp samples, whichever is smaller.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
mixer_t mixer = (mixer_t) effp->priv;
--- a/src/mp3.c
+++ b/src/mp3.c
@@ -261,7 +261,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static sox_size_t sox_mp3read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_mp3read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
struct mp3priv *p = (struct mp3priv *) ft->priv;
sox_size_t donow,i,done=0;
@@ -278,7 +278,7 @@
sample=-MAD_F_ONE;
else if (sample >= MAD_F_ONE)
sample=MAD_F_ONE-1;
- *buf++=(sox_ssample_t)(sample<<(32-1-MAD_F_FRACBITS));
+ *buf++=(sox_sample_t)(sample<<(32-1-MAD_F_FRACBITS));
i++;
}
p->cursamp++;
@@ -414,7 +414,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_mp3write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_mp3write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t samp)
{
struct mp3priv *p = (struct mp3priv *)ft->priv;
char *mp3buffer;
--- a/src/noiseprof.c
+++ b/src/noiseprof.c
@@ -106,7 +106,7 @@
/*
* Grab what we can from ibuf, and process if we have a whole window.
*/
-static int sox_noiseprof_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_noiseprof_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
profdata_t data = (profdata_t) effp->priv;
@@ -149,7 +149,7 @@
* Finish off the last window.
*/
-static int sox_noiseprof_drain(sox_effect_t * effp, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
+static int sox_noiseprof_drain(sox_effect_t * effp, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
{
profdata_t data = (profdata_t) effp->priv;
int tracks = effp->ininfo.channels;
--- a/src/noisered.c
+++ b/src/noisered.c
@@ -201,7 +201,7 @@
/* Do window management once we have a complete window, including mangling
* the current window. */
static int process_window(sox_effect_t * effp, reddata_t data, unsigned chan_num, unsigned num_chans,
- sox_ssample_t *obuf, unsigned len) {
+ sox_sample_t *obuf, unsigned len) {
int j;
float* nextwindow;
int use = min(len, WINDOWSIZE)-min(len,(WINDOWSIZE/2));
@@ -238,7 +238,7 @@
/*
* Read in windows, and call process_window once we get a whole one.
*/
-static int sox_noisered_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_noisered_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
reddata_t data = (reddata_t) effp->priv;
@@ -289,7 +289,7 @@
* We have up to half a window left to dump.
*/
-static int sox_noisered_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_noisered_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
reddata_t data = (reddata_t)effp->priv;
unsigned i;
--- a/src/nulfile.c
+++ b/src/nulfile.c
@@ -39,14 +39,14 @@
return SOX_SUCCESS;
}
-static sox_size_t read(sox_format_t * ft UNUSED, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft UNUSED, sox_sample_t *buf, sox_size_t len)
{
/* Reading from null generates silence i.e. (sox_sample_t)0. */
- memset(buf, 0, sizeof(sox_ssample_t) * len);
+ memset(buf, 0, sizeof(sox_sample_t) * len);
return len; /* Return number of samples "read". */
}
-static sox_size_t write(sox_format_t * ft UNUSED, const sox_ssample_t *buf UNUSED, sox_size_t len)
+static sox_size_t write(sox_format_t * ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t len)
{
/* Writing to null just discards the samples */
return len; /* Return number of samples "written". */
--- a/src/pad.c
+++ b/src/pad.c
@@ -80,7 +80,7 @@
return SOX_EFF_NULL;
}
-static int flow(sox_effect_t * effp, const sox_ssample_t * ibuf, sox_ssample_t * obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t * ibuf, sox_sample_t * obuf,
sox_size_t * isamp, sox_size_t * osamp)
{
pad_t p = (pad_t) effp->priv;
@@ -109,7 +109,7 @@
return SOX_SUCCESS;
}
-static int drain(sox_effect_t * effp, sox_ssample_t * obuf, sox_size_t * osamp)
+static int drain(sox_effect_t * effp, sox_sample_t * obuf, sox_size_t * osamp)
{
static sox_size_t isamp = 0;
pad_t p = (pad_t) effp->priv;
--- a/src/pan.c
+++ b/src/pan.c
@@ -60,17 +60,17 @@
/*
* Process either isamp or osamp samples, whichever is smaller.
*/
-static int sox_pan_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_pan_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
pan_t pan = (pan_t) effp->priv;
sox_size_t len, done;
- sox_ssample_t *ibuf_copy;
+ sox_sample_t *ibuf_copy;
char ich, och;
double left, right, dir, hdir;
- ibuf_copy = (sox_ssample_t *)xmalloc(*isamp * sizeof(sox_ssample_t));
- memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_ssample_t));
+ ibuf_copy = (sox_sample_t *)xmalloc(*isamp * sizeof(sox_sample_t));
+ memcpy(ibuf_copy, ibuf, *isamp * sizeof(sox_sample_t));
dir = pan->dir; /* -1 <= dir <= 1 */
hdir = 0.5 * dir; /* -0.5 <= hdir <= 0.5 */
--- a/src/phaser.c
+++ b/src/phaser.c
@@ -171,12 +171,12 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_phaser_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_phaser_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
phaser_t phaser = (phaser_t) effp->priv;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
sox_size_t len = min(*isamp, *osamp);
*isamp = *osamp = len;
@@ -190,7 +190,7 @@
phaser->maxsamples] * phaser->decay * -1.0;
/* Adjust the output volume and size to 24 bit */
d_out = d_in * phaser->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
phaser->phaserbuf[phaser->counter] = d_in;
@@ -205,13 +205,13 @@
/*
* Drain out reverb lines.
*/
-static int sox_phaser_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_phaser_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
phaser_t phaser = (phaser_t) effp->priv;
sox_size_t done;
double d_in, d_out;
- sox_ssample_t out;
+ sox_sample_t out;
done = 0;
while ( ( done < *osamp ) && ( done < phaser->fade_out ) ) {
@@ -223,7 +223,7 @@
phaser->maxsamples] * phaser->decay * -1.0;
/* Adjust the output volume and size to 24 bit */
d_out = d_in * phaser->out_gain;
- out = SOX_24BIT_CLIP_COUNT((sox_ssample_t) d_out, effp->clips);
+ out = SOX_24BIT_CLIP_COUNT((sox_sample_t) d_out, effp->clips);
*obuf++ = out * 256;
/* Mix decay of delay and input */
phaser->phaserbuf[phaser->counter] = d_in;
--- a/src/pitch.c
+++ b/src/pitch.c
@@ -102,7 +102,7 @@
sox_size_t size; /* size of buffer for processing chunks. */
unsigned int index; /* index of next empty input item. */
- sox_ssample_t *buf; /* bufferize input */
+ sox_sample_t *buf; /* bufferize input */
pitch_state_t state; /* buffer management status. */
@@ -167,7 +167,7 @@
*/
static void interpolation(
pitch_t pitch,
- const sox_ssample_t *ibuf, sox_size_t ilen,
+ const sox_sample_t *ibuf, sox_size_t ilen,
double * out, sox_size_t olen,
double rate) /* signed */
{
@@ -350,7 +350,7 @@
pitch->fade = (double *) xmalloc(pitch->step*sizeof(double));
pitch->tmp = (double *) xmalloc(pitch->step*sizeof(double));
pitch->acc = (double *) xmalloc(pitch->step*sizeof(double));
- pitch->buf = (sox_ssample_t *) xmalloc(pitch->size*sizeof(sox_ssample_t));
+ pitch->buf = (sox_sample_t *) xmalloc(pitch->size*sizeof(sox_sample_t));
pitch->index = pitch->overlap;
/* default initial signal */
@@ -412,7 +412,7 @@
/* Processes input.
*/
-static int sox_pitch_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_pitch_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
pitch_t pitch = (pitch_t) effp->priv;
@@ -437,7 +437,7 @@
{
register int tocopy = min(pitch->size-pitch->index, len);
- memcpy(pitch->buf+pitch->index, ibuf+iindex, tocopy*sizeof(sox_ssample_t));
+ memcpy(pitch->buf+pitch->index, ibuf+iindex, tocopy*sizeof(sox_sample_t));
len -= tocopy;
pitch->index += tocopy;
@@ -489,7 +489,7 @@
/* at the end...
*/
-static int sox_pitch_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_pitch_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
pitch_t pitch = (pitch_t) effp->priv;
sox_size_t i;
--- a/src/polyphas.c
+++ b/src/polyphas.c
@@ -353,8 +353,8 @@
effp->outinfo.channels = effp->ininfo.channels;
- rate->lcmrate = sox_lcm((sox_ssample_t)effp->ininfo.rate,
- (sox_ssample_t)effp->outinfo.rate);
+ rate->lcmrate = sox_lcm((sox_sample_t)effp->ininfo.rate,
+ (sox_sample_t)effp->outinfo.rate);
/* Cursory check for LCM overflow.
* If both rates are below 65k, there should be no problem.
@@ -361,8 +361,8 @@
* 16 bits x 16 bits = 32 bits, which we can handle.
*/
- rate->inskip = rate->lcmrate / (sox_ssample_t)effp->ininfo.rate;
- rate->outskip = rate->lcmrate / (sox_ssample_t)effp->outinfo.rate;
+ rate->inskip = rate->lcmrate / (sox_sample_t)effp->ininfo.rate;
+ rate->outskip = rate->lcmrate / (sox_sample_t)effp->outinfo.rate;
rate->Factor = (double)rate->inskip / (double)rate->outskip;
rate->inpipe = 0;
{
@@ -490,7 +490,7 @@
}
-static int sox_poly_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_poly_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
poly_t rate = (poly_t) effp->priv;
@@ -550,7 +550,7 @@
}
{
- sox_ssample_t *q;
+ sox_sample_t *q;
sox_size_t out_size;
sox_size_t oskip;
Float *out_buf;
@@ -593,7 +593,7 @@
/*
* Process tail of input samples.
*/
-static int sox_poly_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_poly_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
sox_size_t in_size;
/* Call "flow" with NULL input. */
--- a/src/prc.c
+++ b/src/prc.c
@@ -214,7 +214,7 @@
return a;
}
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t samp)
{
prc_t p = (prc_t)ft->priv;
@@ -344,7 +344,7 @@
}
}
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t samp)
{
prc_t p = (prc_t)ft->priv;
/* Psion Record seems not to be able to handle frames > 800 samples */
--- a/src/rabbit.c
+++ b/src/rabbit.c
@@ -106,7 +106,7 @@
/*
* Read, convert, return data.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
rabbit_t r = (rabbit_t) effp->priv;
@@ -163,7 +163,7 @@
/*
* Process samples and write output.
*/
-static int drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
rabbit_t r = (rabbit_t) effp->priv;
static sox_size_t isamp = 0;
--- a/src/raw.c
+++ b/src/raw.c
@@ -86,7 +86,7 @@
#define READ_SAMPLES_FUNC(type, size, sign, ctype, uctype, cast) \
sox_size_t sox_read_ ## sign ## type ## _samples( \
- sox_format_t * ft, sox_ssample_t *buf, sox_size_t len) \
+ sox_format_t * ft, sox_sample_t *buf, sox_size_t len) \
{ \
sox_size_t n, nread; \
ctype *data = xmalloc(sizeof(ctype) * len); \
@@ -113,7 +113,7 @@
#define WRITE_SAMPLES_FUNC(type, size, sign, ctype, uctype, cast) \
sox_size_t sox_write_ ## sign ## type ## _samples( \
- sox_format_t * ft, sox_ssample_t *buf, sox_size_t len) \
+ sox_format_t * ft, sox_sample_t *buf, sox_size_t len) \
{ \
sox_size_t n, nwritten; \
ctype *data = xmalloc(sizeof(ctype) * len); \
@@ -138,7 +138,7 @@
static WRITE_SAMPLES_FUNC(f, sizeof(float), su, float, float, SOX_SAMPLE_TO_FLOAT_32BIT)
static WRITE_SAMPLES_FUNC(df, sizeof(double), su, double, double, SOX_SAMPLE_TO_FLOAT_64BIT)
-typedef sox_size_t (ft_io_fun)(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len);
+typedef sox_size_t (ft_io_fun)(sox_format_t * ft, sox_sample_t *buf, sox_size_t len);
static ft_io_fun *check_format(sox_format_t * ft, sox_bool write)
{
@@ -212,7 +212,7 @@
}
/* Read a stream of some type into SoX's internal buffer format. */
-sox_size_t sox_rawread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp)
+sox_size_t sox_rawread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp)
{
ft_io_fun * read_buf = check_format(ft, sox_false);
@@ -223,12 +223,12 @@
}
/* Writes SoX's internal buffer format to buffer of various data types. */
-sox_size_t sox_rawwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp)
+sox_size_t sox_rawwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp)
{
ft_io_fun *write_buf = check_format(ft, sox_true);
if (write_buf && nsamp)
- return write_buf(ft, (sox_ssample_t *)buf, nsamp);
+ return write_buf(ft, (sox_sample_t *)buf, nsamp);
return 0;
}
--- a/src/repeat.c
+++ b/src/repeat.c
@@ -69,12 +69,12 @@
return (SOX_SUCCESS);
}
-static int sox_repeat_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
+static int sox_repeat_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
repeat_t repeat = (repeat_t)effp->priv;
- if (fwrite((char *)ibuf, sizeof(sox_ssample_t), *isamp, repeat->fp) !=
+ if (fwrite((char *)ibuf, sizeof(sox_sample_t), *isamp, repeat->fp) !=
*isamp) {
sox_fail("write error on temporary file");
return (SOX_EOF);
@@ -85,10 +85,10 @@
return (SOX_SUCCESS);
}
-static int sox_repeat_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_repeat_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
size_t read = 0;
- sox_ssample_t *buf;
+ sox_sample_t *buf;
sox_size_t samp;
sox_size_t done;
@@ -100,12 +100,12 @@
fseeko(repeat->fp, (off_t)0, SEEK_END);
repeat->total = ftello(repeat->fp);
- if ((repeat->total % sizeof(sox_ssample_t)) != 0) {
+ if ((repeat->total % sizeof(sox_sample_t)) != 0) {
sox_fail("corrupted temporary file");
return (SOX_EOF);
}
- repeat->total /= sizeof(sox_ssample_t);
+ repeat->total /= sizeof(sox_sample_t);
repeat->remaining = repeat->total;
fseeko(repeat->fp, (off_t)0, SEEK_SET);
@@ -125,7 +125,7 @@
buf = obuf;
samp = repeat->remaining;
- read = fread((char *)buf, sizeof(sox_ssample_t), samp,
+ read = fread((char *)buf, sizeof(sox_sample_t), samp,
repeat->fp);
if (read != samp) {
perror(strerror(errno));
@@ -151,7 +151,7 @@
repeat->remaining = repeat->total - samp;
- read = fread((char *)buf, sizeof(sox_ssample_t), samp,
+ read = fread((char *)buf, sizeof(sox_sample_t), samp,
repeat->fp);
if (read != samp) {
perror(strerror(errno));
@@ -167,7 +167,7 @@
*osamp = done;
}
else {
- read = fread((char *)obuf, sizeof(sox_ssample_t), *osamp,
+ read = fread((char *)obuf, sizeof(sox_sample_t), *osamp,
repeat->fp);
if (read != *osamp) {
perror(strerror(errno));
--- a/src/resample.c
+++ b/src/resample.c
@@ -273,7 +273,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
resample_t r = (resample_t) effp->priv;
@@ -378,11 +378,11 @@
/*
* Process tail of input samples.
*/
-static int drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
resample_t r = (resample_t) effp->priv;
long isamp_res, osamp_res;
- sox_ssample_t *Obuf;
+ sox_sample_t *Obuf;
int rc;
sox_debug("Xoff %d <--- DRAIN",r->Xoff);
@@ -392,7 +392,7 @@
osamp_res = *osamp;
Obuf = obuf;
while (isamp_res>0 && osamp_res>0) {
- sox_ssample_t Isamp, Osamp;
+ sox_sample_t Isamp, Osamp;
Isamp = isamp_res;
Osamp = osamp_res;
rc = flow(effp, NULL, Obuf, (sox_size_t *)&Isamp, (sox_size_t *)&Osamp);
--- a/src/reverb.c
+++ b/src/reverb.c
@@ -220,8 +220,8 @@
return SOX_SUCCESS;
}
-static int flow(sox_effect_t * effp, const sox_ssample_t * ibuf,
- sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int flow(sox_effect_t * effp, const sox_sample_t * ibuf,
+ sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
priv_t * p = (priv_t *) effp->priv;
sox_size_t c, i, w, len = min(*isamp / p->ichannels, *osamp / p->ochannels);
--- a/src/reverse.c
+++ b/src/reverse.c
@@ -51,7 +51,7 @@
* Effect flow: a degenerate case: write input samples on temporary file,
* don't generate any output samples.
*/
-static int sox_reverse_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf UNUSED,
+static int sox_reverse_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf UNUSED,
sox_size_t *isamp, sox_size_t *osamp)
{
reverse_t reverse = (reverse_t) effp->priv;
@@ -61,7 +61,7 @@
sox_fail("Internal error: reverse_flow called in wrong phase");
return(SOX_EOF);
}
- if (fwrite((char *)ibuf, sizeof(sox_ssample_t), *isamp, reverse->fp)
+ if (fwrite((char *)ibuf, sizeof(sox_sample_t), *isamp, reverse->fp)
!= *isamp)
{
sox_fail("Reverse effect write error on temporary file");
@@ -75,18 +75,18 @@
* Effect drain: generate the actual samples in reverse order.
*/
-static int sox_reverse_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_reverse_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
reverse_t reverse = (reverse_t) effp->priv;
sox_size_t len, nbytes;
register int i, j;
- sox_ssample_t temp;
+ sox_sample_t temp;
if (reverse->phase == WRITING) {
fflush(reverse->fp);
fseeko(reverse->fp, (off_t)0, SEEK_END);
reverse->pos = ftello(reverse->fp);
- if (reverse->pos % sizeof(sox_ssample_t) != 0)
+ if (reverse->pos % sizeof(sox_sample_t) != 0)
{
sox_fail("Reverse effect finds odd temporary file");
return(SOX_EOF);
@@ -94,14 +94,14 @@
reverse->phase = READING;
}
len = *osamp;
- nbytes = len * sizeof(sox_ssample_t);
+ nbytes = len * sizeof(sox_sample_t);
if (reverse->pos < nbytes) {
nbytes = reverse->pos;
- len = nbytes / sizeof(sox_ssample_t);
+ len = nbytes / sizeof(sox_sample_t);
}
reverse->pos -= nbytes;
fseeko(reverse->fp, reverse->pos, SEEK_SET);
- if (fread((char *)obuf, sizeof(sox_ssample_t), len, reverse->fp) != len)
+ if (fread((char *)obuf, sizeof(sox_sample_t), len, reverse->fp) != len)
{
sox_fail("Reverse effect read error from temporary file");
return(SOX_EOF);
--- a/src/silence.c
+++ b/src/silence.c
@@ -36,7 +36,7 @@
char start_unit; /* "d" for decibels or "%" for percent. */
int restart;
- sox_ssample_t *start_holdoff;
+ sox_sample_t *start_holdoff;
sox_size_t start_holdoff_offset;
sox_size_t start_holdoff_end;
int start_found_periods;
@@ -48,7 +48,7 @@
double stop_threshold;
char stop_unit;
- sox_ssample_t *stop_holdoff;
+ sox_sample_t *stop_holdoff;
sox_size_t stop_holdoff_offset;
sox_size_t stop_holdoff_end;
int stop_found_periods;
@@ -254,12 +254,12 @@
else
silence->mode = SILENCE_COPY;
- silence->start_holdoff = (sox_ssample_t *)xmalloc(sizeof(sox_ssample_t)*silence->start_duration);
+ silence->start_holdoff = (sox_sample_t *)xmalloc(sizeof(sox_sample_t)*silence->start_duration);
silence->start_holdoff_offset = 0;
silence->start_holdoff_end = 0;
silence->start_found_periods = 0;
- silence->stop_holdoff = (sox_ssample_t *)xmalloc(sizeof(sox_ssample_t)*silence->stop_duration);
+ silence->stop_holdoff = (sox_sample_t *)xmalloc(sizeof(sox_sample_t)*silence->stop_duration);
silence->stop_holdoff_offset = 0;
silence->stop_holdoff_end = 0;
silence->stop_found_periods = 0;
@@ -267,11 +267,11 @@
return(SOX_SUCCESS);
}
-static int aboveThreshold(sox_effect_t * effp, sox_ssample_t value, double threshold, int unit)
+static int aboveThreshold(sox_effect_t * effp, sox_sample_t value, double threshold, int unit)
{
double ratio;
int rc;
- sox_ssample_t dummy_clipped_count = 0;
+ sox_sample_t dummy_clipped_count = 0;
/* When scaling low bit data, noise values got scaled way up */
/* Only consider the original bits when looking for silence */
@@ -306,11 +306,11 @@
return rc;
}
-static sox_ssample_t compute_rms(sox_effect_t * effp, sox_ssample_t sample)
+static sox_sample_t compute_rms(sox_effect_t * effp, sox_sample_t sample)
{
silence_t silence = (silence_t) effp->priv;
double new_sum;
- sox_ssample_t rms;
+ sox_sample_t rms;
new_sum = silence->rms_sum;
new_sum -= *silence->window_current;
@@ -321,7 +321,7 @@
return (rms);
}
-static void update_rms(sox_effect_t * effp, sox_ssample_t sample)
+static void update_rms(sox_effect_t * effp, sox_sample_t sample)
{
silence_t silence = (silence_t) effp->priv;
@@ -336,7 +336,7 @@
/* Process signed long samples from ibuf to obuf. */
/* Return number of samples processed in isamp and osamp. */
-static int sox_silence_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_silence_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
silence_t silence = (silence_t) effp->priv;
@@ -583,7 +583,7 @@
else /* !(silence->stop) */
{
/* Case B */
- memcpy(obuf, ibuf, sizeof(sox_ssample_t)*nrOfTicks*
+ memcpy(obuf, ibuf, sizeof(sox_sample_t)*nrOfTicks*
effp->ininfo.channels);
nrOfInSamplesRead += (nrOfTicks*effp->ininfo.channels);
nrOfOutSamplesWritten += (nrOfTicks*effp->ininfo.channels);
@@ -623,7 +623,7 @@
return (SOX_SUCCESS);
}
-static int sox_silence_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_silence_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
silence_t silence = (silence_t) effp->priv;
sox_size_t i;
--- a/src/skeleff.c
+++ b/src/skeleff.c
@@ -61,7 +61,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
skeleff_t skeleff = (skeleff_t)effp->priv;
@@ -94,7 +94,7 @@
/*
* Drain out remaining samples if the effect generates any.
*/
-static int drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
*osamp = 0;
/* Return SOX_EOF when drain
--- a/src/skelform.c
+++ b/src/skelform.c
@@ -84,7 +84,7 @@
* Read up to len samples of type sox_sample_t from file into buf[].
* Return number of samples read, or 0 if at end of file.
*/
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
skelform_t sk = (skelform_t)ft->priv;
sox_size_t done;
@@ -159,7 +159,7 @@
* Write len samples of type sox_sample_t from buf[] to file.
* Return number of samples written.
*/
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
skelform_t sk = (skelform_t)ft->priv;
--- a/src/smp.c
+++ b/src/smp.c
@@ -318,7 +318,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static sox_size_t sox_smpread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_smpread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
smp_t smp = (smp_t) ft->priv;
unsigned short datum;
@@ -366,7 +366,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_smpwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_smpwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
smp_t smp = (smp_t) ft->priv;
int datum;
--- a/src/sndfile.c
+++ b/src/sndfile.c
@@ -135,7 +135,7 @@
* Read up to len samples of type sox_sample_t from file into buf[].
* Return number of samples read.
*/
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
sndfile_t sf = (sndfile_t)ft->priv;
@@ -321,7 +321,7 @@
* Write len samples of type sox_sample_t from buf[] to file.
* Return number of samples written.
*/
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
sndfile_t sf = (sndfile_t)ft->priv;
--- a/src/sndrtool.c
+++ b/src/sndrtool.c
@@ -142,7 +142,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t sox_sndtwrite(sox_format_t * ft, const sox_ssample_t * buf,
+static sox_size_t sox_sndtwrite(sox_format_t * ft, const sox_sample_t * buf,
sox_size_t len)
{
snd_t p = (snd_t) ft->priv;
--- a/src/sox.c
+++ b/src/sox.c
@@ -1147,7 +1147,7 @@
files[i]->ft->signal.rate == files[i - 1]->ft->signal.rate;
}
-static sox_size_t sox_read_wide(sox_format_t * ft, sox_ssample_t * buf, sox_size_t max)
+static sox_size_t sox_read_wide(sox_format_t * ft, sox_sample_t * buf, sox_size_t max)
{
sox_size_t len = max / combiner.channels;
len = sox_read(ft, buf, len * ft->signal.channels) / ft->signal.channels;
@@ -1156,7 +1156,7 @@
return len;
}
-static void balance_input(sox_ssample_t * buf, sox_size_t ws, file_t f)
+static void balance_input(sox_sample_t * buf, sox_size_t ws, file_t f)
{
sox_size_t s = ws * f->ft->signal.channels;
@@ -1169,7 +1169,7 @@
typedef struct input_combiner
{
- sox_ssample_t *ibuf[MAX_INPUT_FILES];
+ sox_sample_t *ibuf[MAX_INPUT_FILES];
} * input_combiner_t;
assert_static(sizeof(struct input_combiner) <= SOX_MAX_EFFECT_PRIVSIZE,
@@ -1185,7 +1185,7 @@
else {
ws = 0;
for (i = 0; i < input_count; i++) {
- z->ibuf[i] = (sox_ssample_t *)xmalloc(sox_globals.bufsiz * sizeof(sox_ssample_t));
+ z->ibuf[i] = (sox_sample_t *)xmalloc(sox_globals.bufsiz * sizeof(sox_sample_t));
progress_to_file(files[i]);
ws = max(ws, input_wide_samples);
}
@@ -1194,7 +1194,7 @@
return SOX_SUCCESS;
}
-static int combiner_drain(sox_effect_t *effp, sox_ssample_t * obuf, sox_size_t * osamp)
+static int combiner_drain(sox_effect_t *effp, sox_sample_t * obuf, sox_size_t * osamp)
{
input_combiner_t z = (input_combiner_t) effp->priv;
sox_size_t ws, s, i;
@@ -1215,7 +1215,7 @@
balance_input(obuf, olen, files[current_input]);
break;
} else {
- sox_ssample_t * p = obuf;
+ sox_sample_t * p = obuf;
for (i = 0; i < input_count; ++i) {
ilen[i] = sox_read_wide(files[i]->ft, z->ibuf[i], *osamp);
balance_input(z->ibuf[i], ilen[i], files[i]);
@@ -1266,8 +1266,8 @@
return &handler;
}
-static int output_flow(sox_effect_t *effp UNUSED, sox_ssample_t const * ibuf,
- sox_ssample_t * obuf UNUSED, sox_size_t * isamp, sox_size_t * osamp)
+static int output_flow(sox_effect_t *effp UNUSED, sox_sample_t const * ibuf,
+ sox_sample_t * obuf UNUSED, sox_size_t * isamp, sox_size_t * osamp)
{
size_t len;
for (*osamp = *isamp; *osamp; ibuf += len, *osamp -= len) {
--- a/src/sox.h
+++ b/src/sox.h
@@ -65,18 +65,17 @@
#define SOX_INT32_MAX SOX_INT_MAX(32)
#define SOX_INT64_MAX 0x7fffffffffffffffLL /* Not in use yet */
-typedef int32_t sox_ssample_t;
-typedef uint32_t sox_sample_t;
+typedef int32_t sox_sample_t;
/* Minimum and maximum values a sample can hold. */
-#define SOX_SAMPLE_MAX (sox_ssample_t)SOX_INT_MAX(32)
-#define SOX_SAMPLE_MIN (sox_ssample_t)SOX_INT_MIN(32)
+#define SOX_SAMPLE_MAX (sox_sample_t)SOX_INT_MAX(32)
+#define SOX_SAMPLE_MIN (sox_sample_t)SOX_INT_MIN(32)
/* Conversions: Linear PCM <--> sox_sample_t
*
- * I/O I/O sox_sample_t Clips? I/O sox_sample_t Clips?
+ * I/O I/O sox_sample_t Clips? I/O sox_sample_t Clips?
* Format Minimum Minimum I O Maximum Maximum I O
* ------ --------- ------------ -- -- -------- ------------ -- --
* Float -1 -1.00000000047 y y 1 1 y n
@@ -98,7 +97,7 @@
*/
/* Temporary variables to prevent multiple evaluation of macro arguments: */
-static sox_ssample_t sox_macro_temp_sample UNUSED;
+static sox_sample_t sox_macro_temp_sample UNUSED;
static double sox_macro_temp_double UNUSED;
#define SOX_SAMPLE_NEG SOX_INT_MIN(32)
@@ -105,12 +104,12 @@
#define SOX_SAMPLE_TO_UNSIGNED(bits,d,clips) \
(uint##bits##_t)( \
sox_macro_temp_sample=(d), \
- sox_macro_temp_sample>(sox_ssample_t)(SOX_SAMPLE_MAX-(1U<<(31-bits)))? \
+ sox_macro_temp_sample>(sox_sample_t)(SOX_SAMPLE_MAX-(1U<<(31-bits)))? \
++(clips),SOX_UINT_MAX(bits): \
((uint32_t)(sox_macro_temp_sample^SOX_SAMPLE_NEG)+(1U<<(31-bits)))>>(32-bits))
#define SOX_SAMPLE_TO_SIGNED(bits,d,clips) \
(int##bits##_t)(SOX_SAMPLE_TO_UNSIGNED(bits,d,clips)^SOX_INT_MIN(bits))
-#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_ssample_t)(d)<<(32-bits))
+#define SOX_SIGNED_TO_SAMPLE(bits,d)((sox_sample_t)(d)<<(32-bits))
#define SOX_UNSIGNED_TO_SAMPLE(bits,d)(SOX_SIGNED_TO_SAMPLE(bits,d)^SOX_SAMPLE_NEG)
#define SOX_UNSIGNED_8BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(8,d)
@@ -119,10 +118,10 @@
#define SOX_SIGNED_16BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(16,d)
#define SOX_UNSIGNED_24BIT_TO_SAMPLE(d,clips) SOX_UNSIGNED_TO_SAMPLE(24,d)
#define SOX_SIGNED_24BIT_TO_SAMPLE(d,clips) SOX_SIGNED_TO_SAMPLE(24,d)
-#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_ssample_t)(d)^SOX_SAMPLE_NEG)
-#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_ssample_t)(d)
+#define SOX_UNSIGNED_32BIT_TO_SAMPLE(d,clips) ((sox_sample_t)(d)^SOX_SAMPLE_NEG)
+#define SOX_SIGNED_32BIT_TO_SAMPLE(d,clips) (sox_sample_t)(d)
#define SOX_FLOAT_32BIT_TO_SAMPLE SOX_FLOAT_64BIT_TO_SAMPLE
-#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_macro_temp_double=(d),sox_macro_temp_double<-1?++(clips),(-SOX_SAMPLE_MAX):sox_macro_temp_double>1?++(clips),SOX_SAMPLE_MAX:(sox_ssample_t)((uint32_t)((double)(sox_macro_temp_double)*SOX_SAMPLE_MAX+(SOX_SAMPLE_MAX+.5))-SOX_SAMPLE_MAX))
+#define SOX_FLOAT_64BIT_TO_SAMPLE(d,clips) (sox_macro_temp_double=(d),sox_macro_temp_double<-1?++(clips),(-SOX_SAMPLE_MAX):sox_macro_temp_double>1?++(clips),SOX_SAMPLE_MAX:(sox_sample_t)((uint32_t)((double)(sox_macro_temp_double)*SOX_SAMPLE_MAX+(SOX_SAMPLE_MAX+.5))-SOX_SAMPLE_MAX))
#define SOX_SAMPLE_TO_UNSIGNED_8BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(8,d,clips)
#define SOX_SAMPLE_TO_SIGNED_8BIT(d,clips) SOX_SAMPLE_TO_SIGNED(8,d,clips)
#define SOX_SAMPLE_TO_UNSIGNED_16BIT(d,clips) SOX_SAMPLE_TO_UNSIGNED(16,d,clips)
@@ -288,10 +287,10 @@
const char * const *names;
unsigned int flags;
int (*startread)(sox_format_t * ft);
- sox_size_t (*read)(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len);
+ sox_size_t (*read)(sox_format_t * ft, sox_sample_t *buf, sox_size_t len);
int (*stopread)(sox_format_t * ft);
int (*startwrite)(sox_format_t * ft);
- sox_size_t (*write)(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len);
+ sox_size_t (*write)(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len);
int (*stopwrite)(sox_format_t * ft);
int (*seek)(sox_format_t * ft, sox_size_t offset);
} sox_format_handler_t;
@@ -366,8 +365,8 @@
sox_size_t length,
const sox_instrinfo_t *instr,
const sox_loopinfo_t *loops);
-sox_size_t sox_read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len);
-sox_size_t sox_write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len);
+sox_size_t sox_read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len);
+sox_size_t sox_write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len);
int sox_close(sox_format_t * ft);
#define SOX_SEEK_SET 0
@@ -401,9 +400,9 @@
int (*getopts)(sox_effect_t * effp, int argc, char *argv[]);
int (*start)(sox_effect_t * effp);
- int (*flow)(sox_effect_t * effp, const sox_ssample_t *ibuf,
- sox_ssample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
- int (*drain)(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp);
+ int (*flow)(sox_effect_t * effp, const sox_sample_t *ibuf,
+ sox_sample_t *obuf, sox_size_t *isamp, sox_size_t *osamp);
+ int (*drain)(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp);
int (*stop)(sox_effect_t * effp);
int (*kill)(sox_effect_t * effp);
} sox_effect_handler_t;
@@ -417,7 +416,7 @@
struct sox_signalinfo ininfo; /* input signal specifications */
struct sox_signalinfo outinfo; /* output signal specifications */
sox_effect_handler_t handler;
- sox_ssample_t *obuf; /* output buffer */
+ sox_sample_t *obuf; /* output buffer */
sox_size_t obeg, oend; /* consumed, total length */
sox_size_t imin; /* minimum input buffer size */
sox_size_t clips; /* increment if clipping occurs */
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -117,8 +117,8 @@
double max, /* Maximum value on the y-axis. (e.g. +1) */
double phase); /* Phase at 1st point; 0..2pi. (e.g. pi/2 for cosine) */
-sox_ssample_t sox_gcd(sox_ssample_t a, sox_ssample_t b);
-sox_ssample_t sox_lcm(sox_ssample_t a, sox_ssample_t b);
+sox_sample_t sox_gcd(sox_sample_t a, sox_sample_t b);
+sox_sample_t sox_lcm(sox_sample_t a, sox_sample_t b);
#ifndef HAVE_STRCASECMP
int strcasecmp(const char *s1, const char *s2);
@@ -295,10 +295,10 @@
/* Raw I/O */
int sox_rawstartread(sox_format_t * ft);
-sox_size_t sox_rawread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t nsamp);
+sox_size_t sox_rawread(sox_format_t * ft, sox_sample_t *buf, sox_size_t nsamp);
int sox_rawstopread(sox_format_t * ft);
int sox_rawstartwrite(sox_format_t * ft);
-sox_size_t sox_rawwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t nsamp);
+sox_size_t sox_rawwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t nsamp);
int sox_rawseek(sox_format_t * ft, sox_size_t offset);
/* The following functions can be used to simply return success if
@@ -305,8 +305,8 @@
* a file handler doesn't need to do anything special
*/
int sox_format_nothing(sox_format_t * ft);
-sox_size_t sox_format_nothing_read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len);
-sox_size_t sox_format_nothing_write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len);
+sox_size_t sox_format_nothing_read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len);
+sox_size_t sox_format_nothing_write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len);
int sox_format_nothing_seek(sox_format_t * ft, sox_size_t offset);
int sox_rawstart(sox_format_t * ft, sox_bool default_rate, sox_bool default_channels, sox_encoding_t encoding, int size);
@@ -356,7 +356,7 @@
#define SOX_MAX_EFFECTS 20
sox_effect_t * effects[SOX_MAX_EFFECTS];
unsigned length;
- sox_ssample_t **ibufc, **obufc; /* Channel interleave buffers */
+ sox_sample_t **ibufc, **obufc; /* Channel interleave buffers */
sox_effects_globals_t global_info;
};
#endif
--- a/src/sox_sample_test.c
+++ b/src/sox_sample_test.c
@@ -132,7 +132,7 @@
int16_t int16_2;
int24_t int24_2;
- sox_ssample_t sample;
+ sox_sample_t sample;
sox_size_t clips = 0;
double d;
--- a/src/soxio.c
+++ b/src/soxio.c
@@ -367,13 +367,13 @@
return NULL;
}
-sox_size_t sox_read(sox_format_t * ft, sox_ssample_t * buf, sox_size_t len)
+sox_size_t sox_read(sox_format_t * ft, sox_sample_t * buf, sox_size_t len)
{
sox_size_t actual = ft->handler->read? (*ft->handler->read)(ft, buf, len) : 0;
return (actual > len? 0 : actual);
}
-sox_size_t sox_write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+sox_size_t sox_write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
return ft->handler->write? (*ft->handler->write)(ft, buf, len) : 0;
}
--- a/src/sphere.c
+++ b/src/sphere.c
@@ -206,7 +206,7 @@
}
-static sox_size_t sox_spherewrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_spherewrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
sphere_t sphere = (sphere_t) ft->priv;
--- a/src/stat.c
+++ b/src/stat.c
@@ -129,7 +129,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_stat_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_stat_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
stat_t stat = (stat_t) effp->priv;
@@ -201,7 +201,7 @@
/*
* Process tail of input samples.
*/
-static int sox_stat_drain(sox_effect_t * effp, sox_ssample_t *obuf UNUSED, sox_size_t *osamp)
+static int sox_stat_drain(sox_effect_t * effp, sox_sample_t *obuf UNUSED, sox_size_t *osamp)
{
stat_t stat = (stat_t) effp->priv;
--- a/src/stretch.c
+++ b/src/stretch.c
@@ -55,7 +55,7 @@
sox_size_t size; /* buffer size */
sox_size_t index; /* next available element */
- sox_ssample_t *ibuf; /* input buffer */
+ sox_sample_t *ibuf; /* input buffer */
sox_size_t ishift; /* input shift */
sox_size_t oindex; /* next evailable element */
@@ -153,7 +153,7 @@
stretch->size = (int)(effp->outinfo.rate * 0.001 * stretch->window);
/* start in the middle of an input to avoid initial fading... */
stretch->index = stretch->size / 2;
- stretch->ibuf = (sox_ssample_t *)xmalloc(stretch->size * sizeof(sox_ssample_t));
+ stretch->ibuf = (sox_sample_t *)xmalloc(stretch->size * sizeof(sox_sample_t));
/* the shift ratio deal with the longest of ishift/oshift
hence ishift<=size and oshift<=size. */
@@ -221,7 +221,7 @@
/*
* Processes flow.
*/
-static int sox_stretch_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_stretch_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
stretch_t stretch = (stretch_t) effp->priv;
@@ -233,7 +233,7 @@
sox_size_t tocopy = min(*isamp-iindex,
stretch->size-stretch->index);
- memcpy(stretch->ibuf + stretch->index, ibuf + iindex, tocopy * sizeof(sox_ssample_t));
+ memcpy(stretch->ibuf + stretch->index, ibuf + iindex, tocopy * sizeof(sox_sample_t));
iindex += tocopy;
stretch->index += tocopy;
@@ -288,7 +288,7 @@
* Drain buffer at the end
* maybe not correct ? end might be artificially faded?
*/
-static int sox_stretch_drain(sox_effect_t * effp, sox_ssample_t *obuf, sox_size_t *osamp)
+static int sox_stretch_drain(sox_effect_t * effp, sox_sample_t *obuf, sox_size_t *osamp)
{
stretch_t stretch = (stretch_t) effp->priv;
sox_size_t i;
--- a/src/swap.c
+++ b/src/swap.c
@@ -128,7 +128,7 @@
* Processed signed long samples from ibuf to obuf.
* Return number of samples processed.
*/
-static int sox_swap_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_swap_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
swap_t swap = (swap_t) effp->priv;
--- a/src/synth.c
+++ b/src/synth.c
@@ -167,7 +167,7 @@
char * length_str;
channel_t getopts_channels;
sox_size_t getopts_nchannels;
- sox_ssample_t max;
+ sox_sample_t max;
sox_size_t samples_done;
sox_size_t samples_to_do;
channel_t channels;
@@ -412,7 +412,7 @@
-static sox_ssample_t do_synth(sox_ssample_t synth_input, synth_t synth, int c, double rate)
+static sox_sample_t do_synth(sox_sample_t synth_input, synth_t synth, int c, double rate)
{
channel_t chan = &synth->channels[c];
double synth_out; /* [-1, 1] */
@@ -555,7 +555,7 @@
-static int flow(sox_effect_t * effp, const sox_ssample_t * ibuf, sox_ssample_t * obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t * ibuf, sox_sample_t * obuf,
sox_size_t * isamp, sox_size_t * osamp)
{
synth_t synth = (synth_t) effp->priv;
--- a/src/tempo.c
+++ b/src/tempo.c
@@ -243,8 +243,8 @@
return SOX_SUCCESS;
}
-static int flow(sox_effect_t * effp, const sox_ssample_t * ibuf,
- sox_ssample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
+static int flow(sox_effect_t * effp, const sox_sample_t * ibuf,
+ sox_sample_t * obuf, sox_size_t * isamp, sox_size_t * osamp)
{
priv_t * p = (priv_t *) effp->priv;
sox_size_t i, odone = *osamp /= effp->ininfo.channels;
@@ -265,7 +265,7 @@
return SOX_SUCCESS;
}
-static int drain(sox_effect_t * effp, sox_ssample_t * obuf, sox_size_t * osamp)
+static int drain(sox_effect_t * effp, sox_sample_t * obuf, sox_size_t * osamp)
{
static sox_size_t isamp = 0;
tempo_flush(((priv_t *)effp->priv)->tempo);
--- a/src/trim.c
+++ b/src/trim.c
@@ -92,7 +92,7 @@
* Place in buf[].
* Return number of samples read.
*/
-static int sox_trim_flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int sox_trim_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
int result = SOX_SUCCESS;
--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -177,12 +177,12 @@
/*
* Read up to len samples from file.
- * Convert to sox_sample_ts.
+ * Convert to sox_sample_t.
* Place in buf[].
* Return number of samples read.
*/
-static sox_size_t sox_txwread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_txwread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
txw_t sk = (txw_t) ft->priv;
sox_size_t done = 0;
@@ -221,10 +221,10 @@
sk->rest -= 3; /* adjust remaining for bytes we just read */
s1 = (unsigned short) (uc1 << 4) | (((uc2 >> 4) & 017));
s2 = (unsigned short) (uc3 << 4) | (( uc2 & 017 ));
- *buf = (sox_ssample_t) s1;
+ *buf = (sox_sample_t) s1;
*buf = (*buf << 20);
buf++; /* sample one is done */
- *buf = (sox_ssample_t) s2;
+ *buf = (sox_sample_t) s2;
*buf = (*buf << 20);
buf++; /* sample two is done */
done += 2; /* adjust converted & stored sample count */
@@ -263,10 +263,10 @@
return(SOX_SUCCESS);
}
-static sox_size_t sox_txwwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_txwwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
sox_size_t i;
- sox_ssample_t w1,w2;
+ sox_sample_t w1,w2;
tx16w_len += len;
if (tx16w_len > TXMAXLEN) return 0;
--- a/src/voc.c
+++ b/src/voc.c
@@ -202,8 +202,8 @@
static void blockstart(sox_format_t *);
/* Conversion macros (from raw.c) */
-#define SOX_ALAW_BYTE_TO_SAMPLE(d) ((sox_ssample_t)(sox_alaw2linear16(d)) << 16)
-#define SOX_ULAW_BYTE_TO_SAMPLE(d) ((sox_ssample_t)(sox_ulaw2linear16(d)) << 16)
+#define SOX_ALAW_BYTE_TO_SAMPLE(d) ((sox_sample_t)(sox_alaw2linear16(d)) << 16)
+#define SOX_ULAW_BYTE_TO_SAMPLE(d) ((sox_sample_t)(sox_ulaw2linear16(d)) << 16)
/* public VOC functions for SOX */
/*-----------------------------------------------------------------
@@ -308,7 +308,7 @@
* ANN: Major changes here to support multi-part files and files
* that do not have audio in block 9's.
*-----------------------------------------------------------------*/
-static sox_size_t sox_vocread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_vocread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
vs_t v = (vs_t) ft->priv;
sox_size_t done = 0;
@@ -441,7 +441,7 @@
/*-----------------------------------------------------------------
* sox_vocwrite() -- write a VOC file
*-----------------------------------------------------------------*/
-static sox_size_t sox_vocwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_vocwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
vs_t v = (vs_t) ft->priv;
unsigned char uc;
@@ -474,7 +474,7 @@
static void blockstop(sox_format_t * ft)
{
vs_t v = (vs_t) ft->priv;
- sox_ssample_t datum;
+ sox_sample_t datum;
sox_writeb(ft, 0); /* End of file block code */
sox_seeki(ft, (sox_ssize_t)v->blockseek, 0); /* seek back to block length */
--- a/src/vol.c
+++ b/src/vol.c
@@ -110,7 +110,7 @@
/*
* Process data.
*/
-static int flow(sox_effect_t * effp, const sox_ssample_t *ibuf, sox_ssample_t *obuf,
+static int flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_sample_t *obuf,
sox_size_t *isamp, sox_size_t *osamp)
{
vol_t vol = (vol_t) effp->priv;
--- a/src/vorbis.c
+++ b/src/vorbis.c
@@ -210,12 +210,12 @@
* Return number of samples read.
*/
-static sox_size_t read(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t read(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
vorbis_t vb = (vorbis_t) ft->priv;
sox_size_t i;
int ret;
- sox_ssample_t l;
+ sox_sample_t l;
for(i = 0; i < len; i++) {
@@ -356,7 +356,7 @@
return(SOX_SUCCESS);
}
-static sox_size_t write(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t write(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
vorbis_t vb = (vorbis_t) ft->priv;
vorbis_enc_t *ve = vb->vorbis_enc_data;
--- a/src/vox.c
+++ b/src/vox.c
@@ -27,7 +27,7 @@
return sox_adpcm_ima_start(ft, (adpcm_io_t)ft->priv);
}
-sox_size_t sox_vox_read(sox_format_t * ft, sox_ssample_t *buffer, sox_size_t len)
+sox_size_t sox_vox_read(sox_format_t * ft, sox_sample_t *buffer, sox_size_t len)
{
return sox_adpcm_read(ft, (adpcm_io_t)ft->priv, buffer, len);
}
@@ -37,7 +37,7 @@
return sox_adpcm_stopread(ft, (adpcm_io_t)ft->priv);
}
-sox_size_t sox_vox_write(sox_format_t * ft, const sox_ssample_t *buffer, sox_size_t length)
+sox_size_t sox_vox_write(sox_format_t * ft, const sox_sample_t *buffer, sox_size_t length)
{
return sox_adpcm_write(ft, (adpcm_io_t)ft->priv, buffer, length);
}
--- a/src/vox.h
+++ b/src/vox.h
@@ -12,7 +12,7 @@
int sox_vox_start(sox_format_t * ft);
int sox_ima_start(sox_format_t * ft);
-sox_size_t sox_vox_read(sox_format_t * ft, sox_ssample_t *buffer, sox_size_t len);
+sox_size_t sox_vox_read(sox_format_t * ft, sox_sample_t *buffer, sox_size_t len);
int sox_vox_stopread(sox_format_t * ft);
-sox_size_t sox_vox_write(sox_format_t * ft, const sox_ssample_t *buffer, sox_size_t length);
+sox_size_t sox_vox_write(sox_format_t * ft, const sox_sample_t *buffer, sox_size_t length);
int sox_vox_stopwrite(sox_format_t * ft);
--- a/src/wav.c
+++ b/src/wav.c
@@ -221,7 +221,7 @@
free(wav->gsmsample);
}
-static sox_size_t wavgsmread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t wavgsmread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
size_t done=0;
@@ -289,7 +289,7 @@
return (SOX_SUCCESS);
}
-static sox_size_t wavgsmwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t wavgsmwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
size_t done = 0;
@@ -1001,7 +1001,7 @@
* Return number of samples read.
*/
-static sox_size_t sox_wavread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_wavread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
sox_size_t done;
@@ -1535,7 +1535,7 @@
return SOX_SUCCESS;
}
-static sox_size_t sox_wavwrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_wavwrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t len)
{
wav_t wav = (wav_t) ft->priv;
sox_ssize_t total_len = len;
--- a/src/wve.c
+++ b/src/wve.c
@@ -143,7 +143,7 @@
return SOX_SUCCESS;
}
-static sox_size_t sox_wvewrite(sox_format_t * ft, const sox_ssample_t *buf, sox_size_t samp)
+static sox_size_t sox_wvewrite(sox_format_t * ft, const sox_sample_t *buf, sox_size_t samp)
{
wve_t p = (wve_t)ft->priv;
p->length += samp * ft->signal.size;
--- a/src/xa.c
+++ b/src/xa.c
@@ -194,7 +194,7 @@
* Read up to len samples from a file, converted to signed longs.
* Return the number of samples read.
*/
-static sox_size_t sox_xaread(sox_format_t * ft, sox_ssample_t *buf, sox_size_t len)
+static sox_size_t sox_xaread(sox_format_t * ft, sox_sample_t *buf, sox_size_t len)
{
xa_t xa = (xa_t) ft->priv;
int32_t sample;
@@ -290,7 +290,7 @@
return SOX_EOF;
}
-static sox_size_t sox_xawrite(sox_format_t * ft, const sox_ssample_t *buf UNUSED, sox_size_t len UNUSED)
+static sox_size_t sox_xawrite(sox_format_t * ft, const sox_sample_t *buf UNUSED, sox_size_t len UNUSED)
{
sox_fail_errno(ft, SOX_ENOTSUP, ".XA writing not supported");
return 0;