ref: 0644115219788089d88eecb75e14d5f6191564e4
parent: 271f865d486f712b5ea2aae1f23cf455374f4c7d
author: cbagwell <cbagwell>
date: Sun Feb 6 14:33:26 EST 2000
Cosmetic name change from ft->style to ft->encoding.
--- a/libst.3
+++ b/libst.3
@@ -70,7 +70,7 @@
.P
The format structure contains a list of control parameters for
the sample: sampling rate, data size (bytes, words, floats, etc.),
-style (unsigned, signed, logarithmic), number of sound channels.
+encoding (unsigned, signed, logarithmic), number of sound channels.
It also contains other state information: whether the sample file
needs to be byte-swapped, whether fseek() will work, its suffix,
its file stream pointer, its
--- a/sox.1
+++ b/sox.1
@@ -460,7 +460,7 @@
Sox currently can read PCM, ULAW, ALAW, MS ADPCM, and IMA (or DVI) ADPCM.
It can write all of these formats including
.B (NEW!)
-the ADPCM styles.
+the ADPCM encoding.
.TP 10
.B .wve
Psion 8-bit alaw
@@ -472,13 +472,13 @@
Raw files (no header).
.br
The sample rate, size (byte, word, etc),
-and style (signed, unsigned, etc.)
+and encoding (signed, unsigned, etc.)
of the sample file must be given.
The number of channels defaults to 1.
.TP 10
.B ".ub, .sb, .uw, .sw, .ul, .sl"
These are several suffices which serve as
-a shorthand for raw files with a given size and style.
+a shorthand for raw files with a given size and encoding.
Thus, \fBub, sb, uw, sw, ul\fR and \fBsl\fR
correspond to "unsigned byte", "signed byte",
"unsigned word", "signed word", "ulaw" (byte), and "signed long".
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -177,7 +177,7 @@
ft->info.channels = channels;
ft->info.rate = rate;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_BYTE;
/* open files to channels */
@@ -284,7 +284,7 @@
}
/* write header (channel 0) */
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_BYTE;
p->nsamples = 0;
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -347,7 +347,7 @@
if (foundcomm) {
ft->info.channels = channels;
ft->info.rate = rate;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
switch (bits) {
case 8:
ft->info.size = ST_SIZE_BYTE;
@@ -363,7 +363,7 @@
} else {
if ((ft->info.channels == -1)
|| (ft->info.rate == -1)
- || (ft->info.style == -1)
+ || (ft->info.encoding == -1)
|| (ft->info.size == -1)) {
report("You must specify # channels, sample rate, signed/unsigned,\n");
report("and 8/16 on the command line.");
@@ -563,13 +563,13 @@
}
p->nsamples = 0;
- if ((ft->info.style == ST_ENCODING_ULAW ||
- ft->info.style == ST_ENCODING_ALAW) &&
+ if ((ft->info.encoding == ST_ENCODING_ULAW ||
+ ft->info.encoding == ST_ENCODING_ALAW) &&
ft->info.size == ST_SIZE_BYTE) {
report("expanding 8-bit u-law to 16 bits");
ft->info.size = ST_SIZE_WORD;
}
- ft->info.style = ST_ENCODING_SIGN2; /* We have a fixed style */
+ ft->info.encoding = ST_ENCODING_SIGN2; /* We have a fixed encoding */
/* Compute the "very large number" so that a maximum number
of samples can be transmitted through a pipe without the
@@ -630,15 +630,15 @@
hsize += 8 + 2 + 16*ft->instr.nloops; /* MARK chunk */
hsize += 20; /* INST chunk */
- if (ft->info.style == ST_ENCODING_SIGN2 &&
+ if (ft->info.encoding == ST_ENCODING_SIGN2 &&
ft->info.size == ST_SIZE_BYTE)
bits = 8;
- else if (ft->info.style == ST_ENCODING_SIGN2 &&
+ else if (ft->info.encoding == ST_ENCODING_SIGN2 &&
ft->info.size == ST_SIZE_WORD)
bits = 16;
else
{
- fail("unsupported output style/size for AIFF header");
+ fail("unsupported output encoding/size for AIFF header");
return(ST_EOF);
}
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -26,7 +26,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_alsastartread(ft)
@@ -57,14 +57,14 @@
else
ft->info.size = ST_SIZE_WORD;
}
- if (ft->info.style == -1) {
+ if (ft->info.encoding == -1) {
if ((c_info.hw_formats & SND_PCM_FMT_S16_LE) || (c_info.hw_formats & SND_PCM_FMT_S8))
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
else
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
if (ft->info.size == ST_SIZE_BYTE) {
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_SIGN2:
if (!(c_info.hw_formats & SND_PCM_FMT_S8))
@@ -83,13 +83,13 @@
fmt = SND_PCM_SFMT_U8;
break;
default:
- fail("Hardware does not support %s output", st_encodings_str[ft->info.style]);
+ fail("Hardware does not support %s output", st_encodings_str[ft->info.encoding]);
return(ST_EOF);
break;
}
}
else {
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_SIGN2:
if (!(c_info.hw_formats & SND_PCM_FMT_S16_LE))
@@ -102,7 +102,7 @@
fmt = SND_PCM_SFMT_U16_LE;
break;
default:
- fail("Hardware does not support %s output", st_encodings_str[ft->info.style]);
+ fail("Hardware does not support %s output", st_encodings_str[ft->info.encoding]);
return(ST_EOF);
break;
}
@@ -160,14 +160,14 @@
else
ft->info.size = ST_SIZE_WORD;
}
- if (ft->info.style == -1) {
+ if (ft->info.encoding == -1) {
if ((p_info.hw_formats & SND_PCM_FMT_S16_LE) || (p_info.hw_formats & SND_PCM_FMT_S8))
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
else
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
if (ft->info.size == ST_SIZE_BYTE) {
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_SIGN2:
if (!(p_info.hw_formats & SND_PCM_FMT_S8))
@@ -186,13 +186,13 @@
fmt = SND_PCM_SFMT_U8;
break;
default:
- fail("Hardware does not support %s output", st_encodings_str[ft->info.style]);
+ fail("Hardware does not support %s output", st_encodings_str[ft->info.encoding]);
return(ST_EOF);
break;
}
}
else {
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_SIGN2:
if (!(p_info.hw_formats & SND_PCM_FMT_S16_LE))
@@ -211,7 +211,7 @@
fmt = SND_PCM_SFMT_U16_LE;
break;
default:
- fail("Hardware does not support %s output", st_encodings_str[ft->info.style]);
+ fail("Hardware does not support %s output", st_encodings_str[ft->info.encoding]);
return(ST_EOF);
break;
}
--- a/src/au.c
+++ b/src/au.c
@@ -135,7 +135,7 @@
st_readdw(ft, &encoding);
- /* Translate the encoding into style and size parameters */
+ /* Translate the encoding into encoding and size parameters */
/* (Or, for G.72x, set the decoding routine and parameters) */
p->dec_routine = NULL;
p->in_buffer = 0;
@@ -142,22 +142,22 @@
p->in_bits = 0;
switch (encoding) {
case SUN_ULAW:
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
ft->info.size = ST_SIZE_BYTE;
break;
case SUN_ALAW:
- ft->info.style = ST_ENCODING_ALAW;
+ ft->info.encoding = ST_ENCODING_ALAW;
ft->info.size = ST_SIZE_BYTE;
case SUN_LIN_8:
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_BYTE;
break;
case SUN_LIN_16:
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_WORD;
break;
case SUN_G721:
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_WORD;
g72x_init_state(&p->state);
p->dec_routine = g721_decoder;
@@ -164,7 +164,7 @@
p->dec_bits = 4;
break;
case SUN_G723_3:
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_WORD;
g72x_init_state(&p->state);
p->dec_routine = g723_24_decoder;
@@ -171,7 +171,7 @@
p->dec_bits = 3;
break;
case SUN_G723_5:
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_WORD;
g72x_init_state(&p->state);
p->dec_routine = g723_40_decoder;
@@ -338,24 +338,24 @@
ULONG sample_rate;
ULONG channels;
- if (ft->info.style == ST_ENCODING_ULAW &&
+ if (ft->info.encoding == ST_ENCODING_ULAW &&
ft->info.size == ST_SIZE_BYTE)
encoding = SUN_ULAW;
- else if (ft->info.style == ST_ENCODING_ALAW &&
+ else if (ft->info.encoding == ST_ENCODING_ALAW &&
ft->info.size == ST_SIZE_BYTE)
encoding = SUN_ALAW;
- else if (ft->info.style == ST_ENCODING_SIGN2 &&
+ else if (ft->info.encoding == ST_ENCODING_SIGN2 &&
ft->info.size == ST_SIZE_BYTE)
encoding = SUN_LIN_8;
- else if (ft->info.style == ST_ENCODING_SIGN2 &&
+ else if (ft->info.encoding == ST_ENCODING_SIGN2 &&
ft->info.size == ST_SIZE_WORD)
encoding = SUN_LIN_16;
else {
- report("Unsupported output style/size for Sun/NeXT header or .AU format not specified.");
+ report("Unsupported output encoding/size for Sun/NeXT header or .AU format not specified.");
report("Only U-law, A-law signed bytes, and signed words are supported.");
report("Defaulting to 8khz u-law\n");
encoding = SUN_ULAW;
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
ft->info.size = ST_SIZE_BYTE;
ft->info.rate = 8000; /* strange but true */
}
--- a/src/auto.c
+++ b/src/auto.c
@@ -75,7 +75,7 @@
type = "raw";
ft->info.rate = 11000;
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
report("Type AUTO changed to %s", type);
ft->filetype = type;
--- a/src/avr.c
+++ b/src/avr.c
@@ -58,7 +58,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
@@ -114,10 +114,10 @@
st_readw (ft, &(avr->sign));
if (avr->sign) {
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
else {
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
st_readw (ft, &(avr->loop));
@@ -215,14 +215,14 @@
}
/* sign */
- if (ft->info.style == ST_ENCODING_SIGN2) {
+ if (ft->info.encoding == ST_ENCODING_SIGN2) {
st_writew (ft, 0xffff);
}
- else if (ft->info.style == ST_ENCODING_UNSIGNED) {
+ else if (ft->info.encoding == ST_ENCODING_UNSIGNED) {
st_writew (ft, 0);
}
else {
- fail ("AVR: unsupported style");
+ fail ("AVR: unsupported encoding");
return(ST_EOF);
}
--- a/src/cdr.c
+++ b/src/cdr.c
@@ -35,7 +35,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
@@ -62,7 +62,7 @@
ft->info.rate = 44100L;
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.channels = 2;
ft->comment = NULL;
@@ -121,7 +121,7 @@
ft->info.rate = 44100L;
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.channels = 2;
return(ST_SUCCESS);
--- a/src/compand.c
+++ b/src/compand.c
@@ -173,8 +173,8 @@
# ifdef DEBUG
{
printf("Starting compand effect\n");
- printf("\nRate %ld, size %d, style %d, output gain %g.\n",
- effp->outinfo.rate, effp->outinfo.size, effp->outinfo.style,
+ printf("\nRate %ld, size %d, encoding %d, output gain %g.\n",
+ effp->outinfo.rate, effp->outinfo.size, effp->outinfo.encoding,
l->outgain);
printf("%d input channel(s) expected: actually %d\n",
l->expectedChannels, effp->outinfo.channels);
--- a/src/cvsd.c
+++ b/src/cvsd.c
@@ -127,7 +127,7 @@
ft->info.rate = 8000;
ft->info.channels = 1;
ft->info.size = ST_SIZE_WORD; /* make output format default to words */
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
p->swapbits = ft->swap;
ft->swap = 0;
/*
--- a/src/dat.c
+++ b/src/dat.c
@@ -57,10 +57,10 @@
#endif
}
- /* size and style are really not necessary except to satisfy caller. */
+ /* size and encoding are really not necessary except to satisfy caller. */
ft->info.size = ST_SIZE_DOUBLE;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
return (ST_SUCCESS);
}
@@ -80,7 +80,7 @@
}
ft->info.size = ST_SIZE_DOUBLE;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
dat->timevalue = 0.0;
srate = ft->info.rate;
dat->deltat = 1.0 / srate;
--- a/src/deemphas.c
+++ b/src/deemphas.c
@@ -139,13 +139,13 @@
eff_t effp;
{
/* check the input format */
- if (effp->ininfo.style != ST_ENCODING_SIGN2
+ if (effp->ininfo.encoding != ST_ENCODING_SIGN2
|| effp->ininfo.rate != 44100
|| effp->ininfo.size != ST_SIZE_WORD)
{
fail("The deemphasis effect works only with audio cd like samples.\nThe input format however has %d Hz sample rate and %d-byte%s signed linearly coded samples.",
effp->ininfo.rate, effp->ininfo.size,
- effp->ininfo.style != ST_ENCODING_SIGN2 ? ", but not" : "");
+ effp->ininfo.encoding != ST_ENCODING_SIGN2 ? ", but not" : "");
return (ST_EOF);
}
else
--- a/src/gsm.c
+++ b/src/gsm.c
@@ -55,7 +55,7 @@
struct gsmpriv *p = (struct gsmpriv *) ft->priv;
int ch;
- ft->info.style = ST_ENCODING_GSM;
+ ft->info.encoding = ST_ENCODING_GSM;
ft->info.size = ST_SIZE_BYTE;
if (!ft->info.rate)
ft->info.rate = 8000;
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -124,7 +124,7 @@
st_readw(ft, &dictsize);
/* Translate to sox parameters */
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
ft->info.size = ST_SIZE_BYTE;
ft->info.rate = 22050 / divisor;
ft->info.channels = 1;
@@ -305,7 +305,7 @@
return (ST_EOF);
}
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
ft->info.channels = 1;
p->size = BUFINCR;
--- a/src/mask.c
+++ b/src/mask.c
@@ -60,7 +60,7 @@
LONG tri16; /* 16 signed bits of triangular noise */
len = ((*isamp > *osamp) ? *osamp : *isamp);
- switch (effp->outinfo.style) {
+ switch (effp->outinfo.encoding) {
case ST_ENCODING_ULAW:
case ST_ENCODING_ALAW:
for(done = 0; done < len; done++) {
--- a/src/maud.c
+++ b/src/maud.c
@@ -37,7 +37,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_maudstartread(ft)
@@ -156,19 +156,19 @@
if (bitpersam == 8 && chaninf == 0) {
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
else if (bitpersam == 8 && chaninf == 2) {
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_ALAW;
+ ft->info.encoding = ST_ENCODING_ALAW;
}
else if (bitpersam == 8 && chaninf == 3) {
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
else if (bitpersam == 16 && chaninf == 0) {
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
else
{
@@ -281,12 +281,12 @@
fail("MAUD: unsupported number of channels, unable to store");
return(ST_EOF);
}
- if (ft->info.size == ST_SIZE_WORD) ft->info.style = ST_ENCODING_SIGN2;
- if (ft->info.style == ST_ENCODING_ULAW ||
- ft->info.style == ST_ENCODING_ALAW) ft->info.size = ST_SIZE_BYTE;
+ if (ft->info.size == ST_SIZE_WORD) ft->info.encoding = ST_ENCODING_SIGN2;
+ if (ft->info.encoding == ST_ENCODING_ULAW ||
+ ft->info.encoding == ST_ENCODING_ALAW) ft->info.size = ST_SIZE_BYTE;
if (ft->info.size == ST_SIZE_BYTE &&
- ft->info.style == ST_ENCODING_SIGN2)
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding == ST_ENCODING_SIGN2)
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
p->nsamples = 0x7f000000L;
maudwriteheader(ft);
@@ -341,7 +341,7 @@
st_writedw(ft, (LONG) 8*4); /* number of bytes to follow */
st_writedw(ft, (LONG) (p->nsamples )); /* number of samples stored in MDAT */
- switch (ft->info.style) {
+ switch (ft->info.encoding) {
case ST_ENCODING_UNSIGNED:
st_writew(ft, (int) 8); /* number of bits per sample as stored in MDAT */
@@ -373,7 +373,7 @@
st_writew(ft, (int) 2);
}
- switch (ft->info.style) {
+ switch (ft->info.encoding) {
case ST_ENCODING_UNSIGNED:
case ST_ENCODING_SIGN2:
--- a/src/oss.c
+++ b/src/oss.c
@@ -51,27 +51,27 @@
if (ft->info.size == -1) ft->info.size = ST_SIZE_BYTE;
if (ft->info.size == ST_SIZE_BYTE) {
samplesize = 8;
- if (ft->info.style == -1)
- ft->info.style = ST_ENCODING_UNSIGNED;
- if (ft->info.style != ST_ENCODING_UNSIGNED) {
+ if (ft->info.encoding == -1)
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
+ if (ft->info.encoding != ST_ENCODING_UNSIGNED) {
report("OSS driver only supports unsigned with bytes");
report("Forcing to unsigned");
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
}
else if (ft->info.size == ST_SIZE_WORD) {
samplesize = 16;
- if (ft->info.style == -1)
- ft->info.style = ST_ENCODING_SIGN2;
- if (ft->info.style != ST_ENCODING_SIGN2) {
+ if (ft->info.encoding == -1)
+ ft->info.encoding = ST_ENCODING_SIGN2;
+ if (ft->info.encoding != ST_ENCODING_SIGN2) {
report("OSS driver only supports signed with words");
report("Forcing to signed linear");
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
}
else {
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
report("OSS driver only supports bytes and words");
report("Forcing to signed linear word");
}
@@ -150,7 +150,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_ossdspstartread(ft)
--- a/src/raw.c
+++ b/src/raw.c
@@ -168,7 +168,7 @@
switch(ft->info.size) {
case ST_SIZE_BYTE:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
while(done < nsamp) {
@@ -221,7 +221,7 @@
}
break;
case ST_SIZE_WORD:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
return blockr_sw(buf, nsamp, ft);
@@ -249,7 +249,7 @@
}
break;
case ST_SIZE_DWORD:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
while(done < nsamp) {
@@ -277,7 +277,7 @@
break;
}
fail("Sorry, don't have code to read %s, %s",
- st_encodings_str[ft->info.style], st_sizes_str[ft->info.size]);
+ st_encodings_str[ft->info.encoding], st_sizes_str[ft->info.size]);
return(0);
}
@@ -388,7 +388,7 @@
switch(ft->info.size) {
case ST_SIZE_BYTE:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
while(done < nsamp) {
@@ -437,7 +437,7 @@
}
break;
case ST_SIZE_WORD:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
return blockw_sw(ft,buf,nsamp);
@@ -462,7 +462,7 @@
}
break;
case ST_SIZE_DWORD:
- switch(ft->info.style)
+ switch(ft->info.encoding)
{
case ST_ENCODING_SIGN2:
while(done < nsamp) {
@@ -487,7 +487,7 @@
break;
}
fail("Sorry, don't have code to write %s, %s",
- st_encodings_str[ft->info.style], st_sizes_str[ft->info.size]);
+ st_encodings_str[ft->info.encoding], st_sizes_str[ft->info.size]);
return 0;
}
@@ -509,7 +509,7 @@
ft_t ft; \
{ \
ft->info.size = SIZE; \
- ft->info.style = STYLE; \
+ ft->info.encoding = STYLE; \
rawdefaults(ft); \
return st_rawstartread(ft); \
}
@@ -519,7 +519,7 @@
ft_t ft; \
{ \
ft->info.size = SIZE; \
- ft->info.style = STYLE; \
+ ft->info.encoding = STYLE; \
rawdefaults(ft); \
return st_rawstartwrite(ft); \
}
--- a/src/sf.c
+++ b/src/sf.c
@@ -72,7 +72,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_sfstartread(ft)
@@ -113,11 +113,11 @@
switch(sf->info.sf_packmode) {
case SF_SHORT:
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
break;
case SF_FLOAT:
ft->info.size = ST_SIZE_FLOAT;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
break;
default:
fail("Soundfile input: unknown format 0x%x\n",
@@ -164,8 +164,9 @@
sf->info.sf_packmode = SF_FLOAT;
} else {
sf->info.sf_packmode = SF_SHORT;
+ /* Default to signed words */
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2; /* Default to signed words */
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
sf->info.sf_chans = ft->info.channels;
--- a/src/skel.c
+++ b/src/skel.c
@@ -23,7 +23,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_skelstartread(ft)
@@ -44,7 +44,7 @@
*/
ft->info.rate =
ft->info.size = BYTE or WORD ...;
- ft->info.style = UNSIGNED or SIGN2 ...;
+ ft->info.encoding = UNSIGNED or SIGN2 ...;
ft->info.channels = 1 or 2 or 4;
ft->comment = any comment in file header.
return (ST_SUCCESS);
@@ -110,7 +110,7 @@
/* If your format specifies any of the following info. */
ft->info.rate =
ft->info.size = BYTE or WORD ...;
- ft->info.style = UNSIGNED or SIGN2 ...;
+ ft->info.encoding = UNSIGNED or SIGN2 ...;
ft->info.channels = 1 or 2 or 4;
/* Write file header, if any */
/* Write comment field, if any */
--- a/src/smp.c
+++ b/src/smp.c
@@ -176,7 +176,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_smpstartread(ft)
@@ -264,7 +264,7 @@
ft->info.rate = (int) trailer.rate;
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.channels = 1;
report("SampleVision trailer:\n");
@@ -364,7 +364,7 @@
/* If your format specifies any of the following info. */
ft->info.size = ST_SIZE_WORD;
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.channels = 1;
strcpy(header.Id, SVmagic);
--- a/src/sndrtool.c
+++ b/src/sndrtool.c
@@ -103,7 +103,7 @@
ft->info.channels = 1;
ft->info.rate = rate;
-ft->info.style = ST_ENCODING_UNSIGNED;
+ft->info.encoding = ST_ENCODING_UNSIGNED;
ft->info.size = ST_SIZE_BYTE;
return (ST_SUCCESS);
@@ -137,7 +137,7 @@
/* write header */
ft->info.channels = 1;
-ft->info.style = ST_ENCODING_UNSIGNED;
+ft->info.encoding = ST_ENCODING_UNSIGNED;
ft->info.size = ST_SIZE_BYTE;
p->nsamples = 0;
sndtwriteheader(ft, 0);
@@ -170,7 +170,7 @@
/* write header */
ft->info.channels = 1;
-ft->info.style = ST_ENCODING_UNSIGNED;
+ft->info.encoding = ST_ENCODING_UNSIGNED;
ft->info.size = ST_SIZE_BYTE;
/* sounder header */
--- a/src/sox.c
+++ b/src/sox.c
@@ -317,31 +317,31 @@
case 's':
if (! ft) usage("-s");
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
break;
case 'u':
if (! ft) usage("-u");
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
break;
case 'U':
if (! ft) usage("-U");
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
break;
case 'A':
if (! ft) usage("-A");
- ft->info.style = ST_ENCODING_ALAW;
+ ft->info.encoding = ST_ENCODING_ALAW;
break;
case 'a':
if (! ft) usage("-a");
- ft->info.style = ST_ENCODING_ADPCM;
+ ft->info.encoding = ST_ENCODING_ADPCM;
break;
case 'i':
if (! ft) usage("-i");
- ft->info.style = ST_ENCODING_IMA_ADPCM;
+ ft->info.encoding = ST_ENCODING_IMA_ADPCM;
break;
case 'g':
if (! ft) usage("-g");
- ft->info.style = ST_ENCODING_GSM;
+ ft->info.encoding = ST_ENCODING_GSM;
break;
case 'x':
@@ -374,7 +374,7 @@
/* init files */
informat.info.rate = outformat.info.rate = 0;
informat.info.size = outformat.info.size = -1;
- informat.info.style = outformat.info.style = -1;
+ informat.info.encoding = outformat.info.encoding = -1;
informat.info.channels = outformat.info.channels = -1;
informat.info.bs = outformat.info.bs = 0;
informat.info.dovol = outformat.info.dovol = 0;
@@ -413,9 +413,9 @@
if (informat.info.x0 || informat.info.x1 != MAXULONG)
report("Extract samples %lu <= x < %lu\n", informat.info.x0, informat.info.x0);
- report("Input file: using sample rate %lu\n\tsize %s, style %s, %d %s",
+ report("Input file: using sample rate %lu\n\tsize %s, encoding %s, %d %s",
informat.info.rate, st_sizes_str[informat.info.size],
- st_encodings_str[informat.info.style], informat.info.channels,
+ st_encodings_str[informat.info.encoding], informat.info.channels,
(informat.info.channels > 1) ? "channels" : "channel");
if (informat.comment)
report("Input file: comment \"%s\"\n", informat.comment);
@@ -464,9 +464,9 @@
(* outformat.h->startwrite)(&outformat);
st_checkformat(&outformat);
st_cmpformats(&informat, &outformat);
- report("Output file: using sample rate %lu\n\tsize %s, style %s, %d %s",
+ report("Output file: using sample rate %lu\n\tsize %s, encoding %s, %d %s",
outformat.info.rate, st_sizes_str[outformat.info.size],
- st_encodings_str[outformat.info.style], outformat.info.channels,
+ st_encodings_str[outformat.info.encoding], outformat.info.channels,
(outformat.info.channels > 1) ? "channels" : "channel");
if (outformat.comment)
report("Output file: comment \"%s\"\n", outformat.comment);
--- a/src/st.h
+++ b/src/st.h
@@ -90,7 +90,7 @@
struct st_signalinfo {
LONG rate; /* sampling rate */
int size; /* word length of data */
- int style; /* format of sample numbers */
+ int encoding; /* format of sample numbers */
int channels; /* number of sound channels */
unsigned short bs; /* requested blocksize, eg for output .wav's */
unsigned char dovol; /* has volume factor */
--- a/src/stat.c
+++ b/src/stat.c
@@ -260,9 +260,9 @@
x = (float)(stat->bin[0] + stat->bin[3]) / (float)(stat->bin[1] + stat->bin[2]);
- if (x >= 3.0) /* use opposite style */
+ if (x >= 3.0) /* use opposite encoding */
{
- if (effp->ininfo.style == ST_ENCODING_UNSIGNED)
+ if (effp->ininfo.encoding == ST_ENCODING_UNSIGNED)
{
fprintf (stderr,"\nTry: -t raw -b -s \n");
}
@@ -278,7 +278,7 @@
}
else if (x >= 0.5 && x <= 2.0) /* use ULAW */
{
- if (effp->ininfo.style == ST_ENCODING_ULAW)
+ if (effp->ininfo.encoding == ST_ENCODING_ULAW)
{
fprintf (stderr,"\nTry: -t raw -b -u \n");
}
--- a/src/sunaudio.c
+++ b/src/sunaudio.c
@@ -33,7 +33,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_sunstartread(ft)
@@ -58,7 +58,7 @@
if (ft->info.rate == 0.0) ft->info.rate = 8000;
if (ft->info.size == -1) ft->info.size = ST_SIZE_BYTE;
- if (ft->info.style == -1) ft->info.style = ST_ENCODING_ULAW;
+ if (ft->info.encoding == -1) ft->info.encoding = ST_ENCODING_ULAW;
#ifdef __SVR4
/* Read in old values, change to what we need and then send back */
@@ -78,11 +78,11 @@
{
if (ft->info.size == ST_SIZE_BYTE)
{
- if (ft->info.style != ST_ENCODING_ULAW &&
- ft->info.style != ST_ENCODING_ALAW)
+ if (ft->info.encoding != ST_ENCODING_ULAW &&
+ ft->info.encoding != ST_ENCODING_ALAW)
{
report("Warning: Detected simple hardware. Forcing output to ULAW");
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
}
else if (ft->info.size == ST_SIZE_WORD)
@@ -89,19 +89,19 @@
{
report("Warning: Detected simple hardware. Forcing output to ULAW");
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
}
if (ft->info.size == ST_SIZE_BYTE) {
samplesize = 8;
- if (ft->info.style != ST_ENCODING_ULAW &&
- ft->info.style != ST_ENCODING_ALAW &&
- ft->info.style != ST_ENCODING_SIGN2) {
+ if (ft->info.encoding != ST_ENCODING_ULAW &&
+ ft->info.encoding != ST_ENCODING_ALAW &&
+ ft->info.encoding != ST_ENCODING_SIGN2) {
fail("Sun Audio driver only supports ULAW, ALAW, and Signed Linear for bytes.");
}
- if ((ft->info.style == ST_ENCODING_ULAW ||
- ft->info.style == ST_ENCODING_ALAW) && ft->info.channels == 2)
+ if ((ft->info.encoding == ST_ENCODING_ULAW ||
+ ft->info.encoding == ST_ENCODING_ALAW) && ft->info.channels == 2)
{
report("Warning: only support mono for ULAW and ALAW data. Forcing to mono");
ft->info.channels = 2;
@@ -109,7 +109,7 @@
}
else if (ft->info.size == ST_SIZE_WORD) {
samplesize = 16;
- if (ft->info.style != ST_ENCODING_SIGN2) {
+ if (ft->info.encoding != ST_ENCODING_SIGN2) {
fail("Sun Audio driver only supports Signed Linear for words.");
return(ST_EOF);
}
@@ -137,9 +137,9 @@
audio_if.record.precision = samplesize;
audio_if.record.channels = ft->info.channels;
audio_if.record.sample_rate = ft->info.rate;
- if (ft->info.style == ST_ENCODING_ULAW)
+ if (ft->info.encoding == ST_ENCODING_ULAW)
encoding = AUDIO_ENCODING_ULAW;
- else if (ft->info.style == ST_ENCODING_ALAW)
+ else if (ft->info.encoding == ST_ENCODING_ALAW)
encoding = AUDIO_ENCODING_ALAW;
else
encoding = AUDIO_ENCODING_LINEAR;
@@ -159,7 +159,7 @@
return(ST_EOF);
}
if (audio_if.record.encoding != encoding) {
- fail("Unable to initialize style for /dev/audio");
+ fail("Unable to initialize encoding for /dev/audio");
return(ST_EOF);
}
/* Change to non-buffered I/O*/
@@ -206,11 +206,11 @@
{
if (ft->info.size == ST_SIZE_BYTE)
{
- if (ft->info.style != ST_ENCODING_ULAW &&
- ft->info.style != ST_ENCODING_ALAW)
+ if (ft->info.encoding != ST_ENCODING_ULAW &&
+ ft->info.encoding != ST_ENCODING_ALAW)
{
report("Warning: Detected simple hardware. Forcing output to ULAW");
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
}
else if (ft->info.size == ST_SIZE_WORD)
@@ -217,25 +217,25 @@
{
report("Warning: Detected simple hardware. Forcing output to ULAW");
ft->info.size = ST_SIZE_BYTE;
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
}
if (ft->info.rate == 0.0) ft->info.rate = 8000;
if (ft->info.size == -1) ft->info.size = ST_SIZE_BYTE;
- if (ft->info.style == -1) ft->info.style = ST_ENCODING_ULAW;
+ if (ft->info.encoding == -1) ft->info.encoding = ST_ENCODING_ULAW;
if (ft->info.size == ST_SIZE_BYTE) {
samplesize = 8;
- if (ft->info.style != ST_ENCODING_ULAW &&
- ft->info.style != ST_ENCODING_ALAW &&
- ft->info.style != ST_ENCODING_SIGN2) {
+ if (ft->info.encoding != ST_ENCODING_ULAW &&
+ ft->info.encoding != ST_ENCODING_ALAW &&
+ ft->info.encoding != ST_ENCODING_SIGN2) {
report("Sun Audio driver only supports ULAW, ALAW, and Signed Linear for bytes.");
report("Forcing to ULAW");
- ft->info.style = ST_ENCODING_ULAW;
+ ft->info.encoding = ST_ENCODING_ULAW;
}
- if ((ft->info.style == ST_ENCODING_ULAW ||
- ft->info.style == ST_ENCODING_ALAW) && ft->info.channels == 2)
+ if ((ft->info.encoding == ST_ENCODING_ULAW ||
+ ft->info.encoding == ST_ENCODING_ALAW) && ft->info.channels == 2)
{
report("Warning: only support mono for ULAW and ALAW data. Forcing to mono");
ft->info.channels = 2;
@@ -244,10 +244,10 @@
}
else if (ft->info.size == ST_SIZE_WORD) {
samplesize = 16;
- if (ft->info.style != ST_ENCODING_SIGN2) {
+ if (ft->info.encoding != ST_ENCODING_SIGN2) {
report("Sun Audio driver only supports Signed Linear for words.");
report("Forcing to Signed Linear");
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
}
else {
@@ -267,9 +267,9 @@
audio_if.play.precision = samplesize;
audio_if.play.channels = ft->info.channels;
audio_if.play.sample_rate = ft->info.rate;
- if (ft->info.style == ST_ENCODING_ULAW)
+ if (ft->info.encoding == ST_ENCODING_ULAW)
encoding = AUDIO_ENCODING_ULAW;
- else if (ft->info.style == ST_ENCODING_ALAW)
+ else if (ft->info.encoding == ST_ENCODING_ALAW)
encoding = AUDIO_ENCODING_ALAW;
else
encoding = AUDIO_ENCODING_LINEAR;
@@ -289,7 +289,7 @@
return(ST_EOF);
}
if (audio_if.play.encoding != encoding) {
- fail("Unable to initialize style for /dev/audio");
+ fail("Unable to initialize encoding for /dev/audio");
return(ST_EOF);
}
/* Change to non-buffered I/O */
--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -71,7 +71,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_txwstartread(ft)
@@ -175,7 +175,7 @@
ft->info.channels = 1 ; /* not sure about stereo sample data yet ??? */
ft->info.size = ST_SIZE_WORD; /* this is close enough */
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
return(ST_SUCCESS);
}
@@ -259,10 +259,10 @@
if (ft->info.channels != 1)
report("tx16w is overriding output format to 1 channel.");
ft->info.channels = 1 ; /* not sure about stereo sample data yet ??? */
- if (ft->info.size != ST_SIZE_WORD || ft->info.style != ST_ENCODING_SIGN2)
+ if (ft->info.size != ST_SIZE_WORD || ft->info.encoding != ST_ENCODING_SIGN2)
report("tx16w is overriding output format to size Signed Word format.");
ft->info.size = ST_SIZE_WORD; /* this is close enough */
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
/* If you have to seek around the output file */
if (! ft->seekable)
--- a/src/util.c
+++ b/src/util.c
@@ -174,8 +174,8 @@
ft2->info.size = ft->info.size;
noise = 1;
}
- if (ft2->info.style == -1) {
- ft2->info.style = ft->info.style;
+ if (ft2->info.encoding == -1) {
+ ft2->info.encoding = ft->info.encoding;
noise = 1;
}
if (ft2->info.channels == -1) {
@@ -217,8 +217,8 @@
ft->info.rate, ft->filename);
if (ft->info.size == -1)
fail("Data size was not given for %s file\nUse one of -b/-w/-l/-f/-d/-D", ft->filename);
- if (ft->info.style == -1 && ft->info.size != ST_SIZE_FLOAT)
- fail("Data style was not given for %s file\nUse one of -s/-u/-U/-A", ft->filename);
+ if (ft->info.encoding == -1 && ft->info.size != ST_SIZE_FLOAT)
+ fail("Data encoding was not given for %s file\nUse one of -s/-u/-U/-A", ft->filename);
/* it's so common, might as well default */
if (ft->info.channels == -1)
ft->info.channels = 1;
--- a/src/voc.c
+++ b/src/voc.c
@@ -221,9 +221,9 @@
}
ft->info.size = v->size;
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
if (v->size == ST_SIZE_WORD)
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
if (ft->info.channels == -1)
ft->info.channels = v->channels;
@@ -332,9 +332,9 @@
st_writew(ft, 0x1129); /* checksum of version number */
if (ft->info.size == ST_SIZE_BYTE)
- ft->info.style = ST_ENCODING_UNSIGNED;
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
else
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
if (ft->info.channels == -1)
ft->info.channels = 1;
--- a/src/wav.c
+++ b/src/wav.c
@@ -433,7 +433,7 @@
* Do anything required before you start reading samples.
* Read file header.
* Find out sampling rate,
- * size and style of samples,
+ * size and encoding of samples,
* mono/stereo/quad.
*/
int st_wavstartread(ft)
@@ -507,23 +507,23 @@
case WAVE_FORMAT_PCM:
/* Default (-1) depends on sample size. Set that later on. */
- if (ft->info.style != -1 && ft->info.style != ST_ENCODING_UNSIGNED &&
- ft->info.style != ST_ENCODING_SIGN2)
- warn("User options overriding style read in .wav header");
+ if (ft->info.encoding != -1 && ft->info.encoding != ST_ENCODING_UNSIGNED &&
+ ft->info.encoding != ST_ENCODING_SIGN2)
+ warn("User options overriding encoding read in .wav header");
break;
case WAVE_FORMAT_IMA_ADPCM:
- if (ft->info.style == -1 || ft->info.style == ST_ENCODING_IMA_ADPCM)
- ft->info.style = ST_ENCODING_IMA_ADPCM;
+ if (ft->info.encoding == -1 || ft->info.encoding == ST_ENCODING_IMA_ADPCM)
+ ft->info.encoding = ST_ENCODING_IMA_ADPCM;
else
- warn("User options overriding style read in .wav header");
+ warn("User options overriding encoding read in .wav header");
break;
case WAVE_FORMAT_ADPCM:
- if (ft->info.style == -1 || ft->info.style == ST_ENCODING_ADPCM)
- ft->info.style = ST_ENCODING_ADPCM;
+ if (ft->info.encoding == -1 || ft->info.encoding == ST_ENCODING_ADPCM)
+ ft->info.encoding = ST_ENCODING_ADPCM;
else
- warn("User options overriding style read in .wav header");
+ warn("User options overriding encoding read in .wav header");
break;
case WAVE_FORMAT_IEEE_FLOAT:
@@ -531,17 +531,17 @@
return ST_EOF;
case WAVE_FORMAT_ALAW:
- if (ft->info.style == -1 || ft->info.style == ST_ENCODING_ALAW)
- ft->info.style = ST_ENCODING_ALAW;
+ if (ft->info.encoding == -1 || ft->info.encoding == ST_ENCODING_ALAW)
+ ft->info.encoding = ST_ENCODING_ALAW;
else
- warn("User options overriding style read in .wav header");
+ warn("User options overriding encoding read in .wav header");
break;
case WAVE_FORMAT_MULAW:
- if (ft->info.style == -1 || ft->info.style == ST_ENCODING_ULAW)
- ft->info.style = ST_ENCODING_ULAW;
+ if (ft->info.encoding == -1 || ft->info.encoding == ST_ENCODING_ULAW)
+ ft->info.encoding = ST_ENCODING_ULAW;
else
- warn("User options overriding style read in .wav header");
+ warn("User options overriding encoding read in .wav header");
break;
case WAVE_FORMAT_OKI_ADPCM:
@@ -558,10 +558,10 @@
return ST_EOF;
case WAVE_FORMAT_GSM610:
#ifdef HAVE_LIBGSM
- if (ft->info.style == -1 || ft->info.style == ST_ENCODING_GSM )
- ft->info.style = ST_ENCODING_GSM;
+ if (ft->info.encoding == -1 || ft->info.encoding == ST_ENCODING_GSM )
+ ft->info.encoding = ST_ENCODING_GSM;
else
- warn("User options overriding style read in .wav header");
+ warn("User options overriding encoding read in .wav header");
break;
#else
fail("Sorry, this WAV file is in GSM6.10 format and no GSM support present, recompile sox with gsm library");
@@ -785,9 +785,9 @@
else
warn("User options overriding size read in .wav header");
- /* Now we have enough information to set default styles. */
- if (ft->info.style == -1)
- ft->info.style = ST_ENCODING_UNSIGNED;
+ /* Now we have enough information to set default encodings. */
+ if (ft->info.encoding == -1)
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
break;
case ST_SIZE_WORD:
@@ -796,9 +796,9 @@
else
warn("User options overriding size read in .wav header");
- /* Now we have enough information to set default styles. */
- if (ft->info.style == -1)
- ft->info.style = ST_ENCODING_SIGN2;
+ /* Now we have enough information to set default encodings. */
+ if (ft->info.encoding == -1)
+ ft->info.encoding = ST_ENCODING_SIGN2;
break;
case ST_SIZE_DWORD:
@@ -807,9 +807,9 @@
else
warn("User options overriding size read in .wav header");
- /* Now we have enough information to set default styles. */
- if (ft->info.style == -1)
- ft->info.style = ST_ENCODING_SIGN2;
+ /* Now we have enough information to set default encodings. */
+ if (ft->info.encoding == -1)
+ ft->info.encoding = ST_ENCODING_SIGN2;
break;
default:
@@ -907,9 +907,9 @@
if (len > wav->numSamples) len = wav->numSamples;
- /* If file is in ADPCM style then read in multiple blocks else */
+ /* If file is in ADPCM encoding then read in multiple blocks else */
/* read as much as possible and return quickly. */
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_IMA_ADPCM:
case ST_ENCODING_ADPCM:
@@ -959,7 +959,7 @@
warn("Premature EOF on .wav input file");
break;
#endif
- default: /* assume PCM style */
+ default: /* assume PCM encoding */
done = st_rawread(ft, buf, len);
/* If software thinks there are more samples but I/O */
/* says otherwise, let the user know about this. */
@@ -985,7 +985,7 @@
if (wav->samples) free(wav->samples);
if (wav->iCoefs) free(wav->iCoefs);
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
#ifdef HAVE_LIBGSM
case ST_ENCODING_GSM:
@@ -1154,43 +1154,43 @@
{
case ST_SIZE_BYTE:
wBitsPerSample = 8;
- if (ft->info.style != ST_ENCODING_UNSIGNED &&
- ft->info.style != ST_ENCODING_ULAW &&
- ft->info.style != ST_ENCODING_ALAW &&
- ft->info.style != ST_ENCODING_GSM)
+ if (ft->info.encoding != ST_ENCODING_UNSIGNED &&
+ ft->info.encoding != ST_ENCODING_ULAW &&
+ ft->info.encoding != ST_ENCODING_ALAW &&
+ ft->info.encoding != ST_ENCODING_GSM)
{
- warn("Do not support %s with 8-bit data. Forcing to unsigned",st_encodings_str[ft->info.style]);
- ft->info.style = ST_ENCODING_UNSIGNED;
+ warn("Do not support %s with 8-bit data. Forcing to unsigned",st_encodings_str[ft->info.encoding]);
+ ft->info.encoding = ST_ENCODING_UNSIGNED;
}
break;
case ST_SIZE_WORD:
wBitsPerSample = 16;
- if (ft->info.style != ST_ENCODING_SIGN2)
+ if (ft->info.encoding != ST_ENCODING_SIGN2)
{
- warn("Do not support %s with 16-bit data. Forcing to Signed.",st_encodings_str[ft->info.style]);
- ft->info.style = ST_ENCODING_SIGN2;
+ warn("Do not support %s with 16-bit data. Forcing to Signed.",st_encodings_str[ft->info.encoding]);
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
break;
case ST_SIZE_DWORD:
wBitsPerSample = 32;
- if (ft->info.style != ST_ENCODING_SIGN2)
+ if (ft->info.encoding != ST_ENCODING_SIGN2)
{
- warn("Do not support %s with 16-bit data. Forcing to Signed.",st_encodings_str[ft->info.style]);
- ft->info.style = ST_ENCODING_SIGN2;
+ warn("Do not support %s with 16-bit data. Forcing to Signed.",st_encodings_str[ft->info.encoding]);
+ ft->info.encoding = ST_ENCODING_SIGN2;
}
break;
default:
warn("Do not support %s in WAV files. Forcing to Signed Words.",st_sizes_str[ft->info.size]);
- ft->info.style = ST_ENCODING_SIGN2;
+ ft->info.encoding = ST_ENCODING_SIGN2;
ft->info.size = ST_SIZE_WORD;
wBitsPerSample = 16;
break;
}
- if (ft->info.style != ST_ENCODING_ADPCM &&
- ft->info.style != ST_ENCODING_IMA_ADPCM &&
- ft->info.style != ST_ENCODING_GSM)
+ if (ft->info.encoding != ST_ENCODING_ADPCM &&
+ ft->info.encoding != ST_ENCODING_IMA_ADPCM &&
+ ft->info.encoding != ST_ENCODING_GSM)
{
rc = st_rawstartwrite(ft);
if (rc)
@@ -1199,7 +1199,7 @@
wSamplesPerBlock = 1; /* common default for PCM data */
- switch (ft->info.style)
+ switch (ft->info.encoding)
{
case ST_ENCODING_UNSIGNED:
case ST_ENCODING_SIGN2:
@@ -1228,7 +1228,6 @@
wSamplesPerBlock = ImaSamplesIn(0, wChannels, wBlockAlign, 0);
break;
case ST_ENCODING_ADPCM:
- /* warn("Experimental support writing ADPCM style.\n"); */
if (wChannels>16)
{
fail("Channels(%d) must be <= 16\n",wChannels);
--- a/src/wve.c
+++ b/src/wve.c
@@ -92,7 +92,7 @@
(void)st_readw(ft, (unsigned short *)&trash);
(void)st_readw(ft, (unsigned short *)&trash);
- ft->info.style = ST_ENCODING_ALAW;
+ ft->info.encoding = ST_ENCODING_ALAW;
ft->info.size = ST_SIZE_BYTE;
ft->info.rate = 8000;
@@ -137,7 +137,7 @@
if (p->repeats == 0)
p->repeats = 1;
- ft->info.style = ST_ENCODING_ALAW;
+ ft->info.encoding = ST_ENCODING_ALAW;
ft->info.size = ST_SIZE_BYTE;
ft->info.rate = 8000;