ref: f82246b0f974f21408219c993584a2ca41b282d9
parent: 5c183d4c4480a5ef1bb5b0fd611a4122f79c8833
author: robs <robs>
date: Sat Feb 16 17:11:41 EST 2008
removing deprecated stuff
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,12 +4,27 @@
This file contains a list of all changes starting after the release of
sox-11gamma.
-sox-14.0.2 2008-TBD
+
+sox-14.1.0 2008-TBD
----------
+Deprecated features removed in this release:
+
+ Deprec- Feature [O(ption)] Removal
+ ated in [F(ormat)] [E(ffect)] Replacement due in
+ ------- ---------------------- ---------------------- -------
+ 13.0.0 O -e -n 14.1.0
+ 13.0.0 O -b/-w/-l/-d -1/-2/-4/-8 14.1.0
+ 13.0.0 E avg, pick mixer 14.1.0
+ 13.0.0 E highp, lowp highpass -1, lowpass -1 14.1.0
+ 13.0.0 E mask dither 14.1.0
+ 13.0.0 E rate ~= resample 14.1.0
+ 13.0.0 E vibro ~= tremolo 14.1.0
+ 13.0.0 F auto Becomes internal only 14.1.0
+
File formats:
- o No change
+ o None new.
Effects:
@@ -26,29 +41,22 @@
Bug fixes:
o Fix [1864216] comments mangled when writing ogg-vorbis. (robs)
- o Fix crash on 64-bit arch with tempo & key effects. (Sami Liedes)
+ o Fix crash on 64-bit arch. with tempo & key effects. (Sami Liedes)
Internal improvements:
o Use FORTIFY_SOURCE with gcc. (robs)
+ o Fixed all compiler warnings (AFAICT). (robs)
-Feature deprecation & removal:
+Deprecated features to be removed in future:
Deprec- Feature [O(ption)] Removal
ated in [F(ormat)] [E(ffect)] Replacement due in
------- ---------------------- ---------------------- -------
- 13.0.0 O -e -n 14.0.2
- 13.0.0 O -b/-w/-l/-d -1/-2/-4/-8 14.0.2
- 13.0.0 E avg, pick mixer 14.0.2
- 13.0.0 E highp, lowp highpass -1, lowpass -1 14.0.2
- 13.0.0 E mask dither 14.0.2
- 13.0.0 E rate ~= resample 14.0.2
- 13.0.0 E vibro ~= tremolo 14.0.2
- 13.0.0 F auto Becomes internal only 14.0.2
14.0.0 E stretch ~= tempo 2008-09-11
14.0.0 E pitch ~= key 2008-09-11
- 14.0.2 F wve (native) wve (libsndfile) 14.0.2 + 1 year
- 14.0.2 F flac: libFLAC 1.1.1 libFLAC > 1.1.1 14.0.2 + 6 months
+ 14.1.0 F wve (native) wve (libsndfile) 14.1.0 + 1 year
+ 14.1.0 F flac: libFLAC 1.1.1 libFLAC > 1.1.1 14.1.0 + 6 months
sox-14.0.1 2008-01-29
--- a/README
+++ b/README
@@ -72,7 +72,7 @@
o Bass tone control
o Compress and Expand (compand) the dynamic range of a sample
o Chorus effect
- o DCShift audio - useful to get the best volume adjustments
+ o DC-shift audio - useful to get the best volume adjustments
o De-emphasis filter
o Move sound stage of CD audio to in front of you (for headphone
use)
@@ -89,7 +89,7 @@
o Pad with silence
o Pan sound between channels
o Apply a phaser effect
- o Change the pitch of a sound file without affecting its speed
+ o Change the key (pitch) of a sound file without affecting its speed
o Repeat audio data
o Change sampling rates using several different algorithms. A
'resample' and 'polyphase' effect use high-grade signal rate
@@ -98,17 +98,16 @@
o Reverse the sound samples (to search for Satanic messages ;-)
o Detect periods of silence and start and stop processing based on
it
- o Change the speed of samples being played (like speeding up the
+ o Change speed (pitch and tempo together)
motor on a tape recorder)
o Splice together audio sections
o Display general stats on a sound sample
- o Stretch/shorten the duration of a sound file (without affecting
- pitch)
+ o Change the tempo an audio file (without affecting pitch)
o Swap stereo channels
o Create sounds with a simple synthesizer
o Treble tone control
o Trim audio data from beginning and end of file
- o Apply a tremolo (a.k.a. vibrato) effect
+ o Apply a tremolo effect
o Volume adjustment
o Noise elimination using frequency profiling
o Resample using libsamplerate (aka Secret Rabbit code, optional
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(SoX, 14.0.2, sox-devel@lists.sourceforge.net)
+AC_INIT(SoX, 14.1.0, sox-devel@lists.sourceforge.net)
dnl Find target architecture
AC_CANONICAL_TARGET
--- a/sox.1
+++ b/sox.1
@@ -466,11 +466,6 @@
is by default 48\ kHz, but, as with a normal
file, this can be overridden if desired using command-line format
options (see below).
-.TP
-\fB\-e\fR
-This is an alias of
-.B \-n
-and is retained for backwards compatibility only.
.SH OPTIONS
.SS Global Options
These options can be specified on the command line at any point
--- a/soxeffect.7
+++ b/soxeffect.7
@@ -1413,38 +1413,6 @@
included in another effect. They continue to work in this version of
SoX but may be removed in future.
.TP
-\fBavg\fR [ \fB\-l\fR\^|\^\fB\-r\fR\^|\^\fB\-f\fR\^|\^\fB\-b\fR\^|\^\fB\-1\fR\^|\^\fB\-2\fR\^|\^\fB\-3\fR\^|\^\fB\-4\fR\^|\^\fIn\fR{\fB,\fIn\fR} ]
-Reduce the number of audio channels by mixing or selecting channels,
-or duplicate channels to increase the number of channels.
-This effect is just an alias of the
-.B mixer
-effect and is retained for backwards compatibility only.
-.TP
-\fBhighp\fR \fIfrequency\fR
-Apply a high-pass filter.
-This effect is just an alias for the
-.B highpass
-effect used with its
-.B \-1
-option; it is retained for backwards compatibility only.
-.TP
-\fBlowp \fIfrequency\fR
-Apply a low-pass filter.
-This effect is just an alias for the
-.B lowpass
-effect used with its
-.B \-1
-option; it is retained for backwards compatibility only.
-.TP
-\fBmask\fR [\fIdepth\fR]
-This effect is just a deprecated alias for the \fBdither\fR effect, left for historical reasons.
-.TP
-\fBpick\fR [ \fB\-l\fR\^|\^\fB\-r\fR\^|\^\fB\-f\fR\^|\^\fB\-b\fR\^|\^\fB\-1\fR\^|\^\fB\-2\fR\^|\^\fB\-3\fR\^|\^\fB\-4\fR\^|\^\fIn\fR{\fB,\fIn\fR} ]
-Pick a subset of channels to be copied into the output file.
-This effect is just an alias of the
-.B mixer
-effect and is retained for backwards compatibility only.
-.TP
\fBpitch \fIshift\fR [\fIwidth interpolate fade\fR]
Change the audio pitch (but not its duration).
This effect is equivalent to the
@@ -1467,10 +1435,6 @@
option, can be \fBcos\fR, \fBhamming\fR, \fBlinear\fR or
\fBtrapezoid\fR; the default is \fBcos\fR.
.TP
-\fBrate\fR
-Does the same as \fBresample\fR with no parameters; it exists for
-backwards compatibility.
-.TP
\fBstretch \fIfactor\fR [\fIwindow fade shift fading\fR]
Change the audio duration (but not its pitch).
This effect is equivalent to the
@@ -1493,11 +1457,6 @@
ratio, in [0 0\*d5]. The amount of a fade's default depends on
.I factor
and \fIshift\fR.
-.TP
-\fBvibro \fIspeed\fR [\fIdepth\fR]
-This is a deprecated alias for the
-.B tremolo
-effect. It differs in that the depth parameter ranges from 0 to 1 and defaults to 0\*d5.
.SH SEE ALSO
.BR sox (1),
.BR soxi (1),
--- a/soxformat.7
+++ b/soxformat.7
@@ -179,11 +179,6 @@
.B \-c
options, in which case SoX will issue a warning to that effect.
.TP
-\fBauto\fR
-This format type name exists for backwards compatibility only.
-If given for an input file it will be silently ignored,
-if given for an output file it will cause SoX to exit with an error.
-.TP
.B .avr
Audio Visual Research.
The AVR format is produced by a number of commercial packages
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -377,7 +377,7 @@
sox_svxstartwrite,
sox_svxwrite,
sox_svxstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_svx_format_fn(void);
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,15 +18,15 @@
# Format with: !xargs echo|tr ' ' '\n'|sort|column|expand|sed 's/^/ /'
set(effects_srcs
- biquad echos noiseprof remix stat
- biquads effects noisered repeat stretch
- chorus fade normalise resample swap
- compand FFT pad reverb synth
- compandt filter pan reverse tempo
- dcshift flanger phaser silence tremolo
- dither key pitch skeleff trim
- earwax mcompand polyphas speed vibro
- echo mixer rate splice vol
+ biquad echos noiseprof repeat stretch
+ biquads effects noisered resample swap
+ chorus fade normalise reverb synth
+ compand FFT pad reverse tempo
+ compandt filter pan silence tremolo
+ dcshift flanger phaser skeleff trim
+ dither key pitch speed vol
+ earwax mcompand polyphas splice
+ echo mixer remix stat
)
set(formats_srcs
8svx cvsd hcom s1-fmt u2-fmt
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -196,10 +196,10 @@
compandt.c compandt.h dcshift.c dither.c earwax.c echo.c echos.c \
effects.c effects.h fade.c FFT.c FFT.h fifo.h filter.c flanger.c key.c \
ladspa.c mcompand.c mixer.c noiseprof.c noisered.c noisered.h pad.c \
- pan.c phaser.c pitch.c polyphas.c rabbit.c rate.c remix.c repeat.c \
+ pan.c phaser.c pitch.c polyphas.c rabbit.c remix.c repeat.c \
resample.c reverb.c reverse.c silence.c skeleff.c speed.c \
splice.c stat.c stretch.c swap.c synth.c tempo.c tremolo.c trim.c \
- vibro.c vol.c normalise.c
+ vol.c normalise.c
libsfx_la_CFLAGS = @SAMPLERATE_CFLAGS@
libsfx_la_LIBADD = @SAMPLERATE_LIBS@ libsox.la
--- a/src/alsa.c
+++ b/src/alsa.c
@@ -689,7 +689,7 @@
sox_alsastartwrite,
sox_alsawrite,
sox_alsastopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_alsa_format_fn(void);
--- a/src/ao.c
+++ b/src/ao.c
@@ -33,12 +33,6 @@
sox_size_t buf_size;
} *ao_priv_t;
-static int startread(UNUSED sox_format_t * ft)
-{
- sox_fail("Cannot read from libao driver");
- return SOX_EOF;
-}
-
static int startwrite(sox_format_t * ft)
{
ao_priv_t ao = (ao_priv_t)ft->priv;
@@ -143,15 +137,10 @@
};
static sox_format_handler_t sox_ao_format = {
- aonames,
- SOX_FILE_DEVICE | SOX_FILE_NOSTDIO,
- startread,
- sox_format_nothing_read,
- sox_format_nothing,
- startwrite,
- write,
- stopwrite,
- sox_format_nothing_seek
+ aonames, SOX_FILE_DEVICE | SOX_FILE_NOSTDIO,
+ NULL, NULL, NULL,
+ startwrite, write, stopwrite,
+ NULL
};
const sox_format_handler_t *sox_ao_format_fn(void);
--- a/src/auto.c
+++ b/src/auto.c
@@ -152,7 +152,7 @@
free(ft->filetype);
ft->filetype = xstrdup(type);
ft->mode = 'r';
- rc = sox_gettype(ft, sox_true); /* Change ft->h to the new format */
+ rc = sox_gettype(ft, sox_true); /* Change to the new format */
if (rc != SOX_SUCCESS)
return (rc);
@@ -161,32 +161,14 @@
return ft->handler->startread? (* ft->handler->startread)(ft) : SOX_SUCCESS;
}
-static int sox_autostartwrite(sox_format_t * ft)
-{
- sox_fail_errno(ft,SOX_EFMT,"Type AUTO can only be used for input!");
- return(SOX_EOF);
-}
-
-static const char *autonames[] = {
- "auto",
- NULL
-};
-
-static sox_format_handler_t sox_auto_format = {
- autonames,
- SOX_FILE_DEVICE | SOX_FILE_PHONY,
- sox_autostartread,
- sox_format_nothing_read,
- sox_format_nothing,
- sox_autostartwrite,
- sox_format_nothing_write,
- sox_format_nothing,
- sox_format_nothing_seek
-};
-
const sox_format_handler_t *sox_auto_format_fn(void);
-
const sox_format_handler_t *sox_auto_format_fn(void)
{
- return &sox_auto_format;
+ static const char *autonames[] = {"magic", NULL};
+
+ static sox_format_handler_t sox_auto_format = {
+ autonames, SOX_FILE_DEVICE | SOX_FILE_PHONY,
+ sox_autostartread, NULL, NULL, NULL, NULL, NULL, NULL
+ };
+ return &sox_auto_format;
}
--- a/src/avr.c
+++ b/src/avr.c
@@ -291,7 +291,7 @@
sox_avrstartwrite,
sox_avrwrite,
sox_avrstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_avr_format_fn(void);
--- a/src/biquads.c
+++ b/src/biquads.c
@@ -320,8 +320,6 @@
return &handler; \
}
-BIQUAD_EFFECT(highp, hilo1, "cutoff-frequency", SOX_EFF_DEPRECATED)
-BIQUAD_EFFECT(lowp, hilo1, "cutoff-frequency", SOX_EFF_DEPRECATED)
BIQUAD_EFFECT(highpass, hilo2, "[-1|-2] frequency [width[q|o|h]]", 0)
BIQUAD_EFFECT(lowpass, hilo2, "[-1|-2] frequency [width[q|o|h]]", 0)
BIQUAD_EFFECT(bandpass, bandpass, "[-c] frequency width[h|q|o]", 0)
--- a/src/cvsd-fmt.c
+++ b/src/cvsd-fmt.c
@@ -40,7 +40,7 @@
sox_cvsdstartwrite,
sox_cvsdwrite,
sox_cvsdstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_cvsd_format_fn(void);
--- a/src/dat.c
+++ b/src/dat.c
@@ -166,7 +166,7 @@
sox_datstartwrite,
sox_datwrite,
sox_format_nothing,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_dat_format_fn(void);
--- a/src/dither.c
+++ b/src/dither.c
@@ -84,12 +84,3 @@
};
return &handler;
}
-
-sox_effect_handler_t const * sox_mask_effect_fn(void)
-{
- static sox_effect_handler_t handler;
- handler = *sox_dither_effect_fn();
- handler.name = "mask";
- handler.flags |= SOX_EFF_DEPRECATED;
- return &handler;
-}
--- a/src/dvms-fmt.c
+++ b/src/dvms-fmt.c
@@ -40,7 +40,7 @@
sox_dvmsstartwrite,
sox_cvsdwrite,
sox_dvmsstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_dvms_format_fn(void);
--- a/src/effects.h
+++ b/src/effects.h
@@ -1,7 +1,6 @@
/* FIXME: generate this list automatically */
EFFECT(allpass)
- EFFECT(avg)
EFFECT(band)
EFFECT(bandpass)
EFFECT(bandreject)
@@ -19,14 +18,11 @@
EFFECT(filter)
EFFECT(flanger)
EFFECT(highpass)
- EFFECT(highp)
EFFECT(key)
#ifdef HAVE_LADSPA_H
EFFECT(ladspa)
#endif
EFFECT(lowpass)
- EFFECT(lowp)
- EFFECT(mask)
EFFECT(mcompand)
EFFECT(mixer)
EFFECT(noiseprof)
@@ -36,13 +32,11 @@
EFFECT(pad)
EFFECT(pan)
EFFECT(phaser)
- EFFECT(pick)
EFFECT(pitch)
EFFECT(polyphase)
#ifdef HAVE_SAMPLERATE_H
EFFECT(rabbit)
#endif
- EFFECT(rate)
EFFECT(remix)
EFFECT(repeat)
EFFECT(resample)
@@ -59,5 +53,4 @@
EFFECT(treble)
EFFECT(tremolo)
EFFECT(trim)
- EFFECT(vibro)
EFFECT(vol)
--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -495,7 +495,7 @@
startwrite,
write,
stopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_ffmpeg_format_fn(void);
--- a/src/gsm.c
+++ b/src/gsm.c
@@ -250,7 +250,7 @@
sox_gsmstartwrite,
sox_gsmwrite,
sox_gsmstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_gsm_format_fn(void);
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -477,7 +477,7 @@
sox_hcomstartwrite,
sox_hcomwrite,
sox_hcomstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_hcom_format_fn(void);
--- a/src/ima-fmt.c
+++ b/src/ima-fmt.c
@@ -26,7 +26,7 @@
sox_ima_start,
sox_vox_write,
sox_vox_stopwrite,
- sox_format_nothing_seek
+ NULL
};
return &handler;
}
--- a/src/lpc10.c
+++ b/src/lpc10.c
@@ -227,7 +227,7 @@
startwrite,
write,
stopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_lpc10_format_fn(void);
--- a/src/maud.c
+++ b/src/maud.c
@@ -353,7 +353,7 @@
sox_maudstartwrite,
sox_maudwrite,
sox_maudstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_maud_format_fn(void);
--- a/src/misc.c
+++ b/src/misc.c
@@ -312,8 +312,6 @@
/* 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_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 */
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -539,23 +539,6 @@
return &handler;
}
-sox_effect_handler_t const * sox_avg_effect_fn(void)
-{
- static sox_effect_handler_t handler;
- handler = *sox_mixer_effect_fn();
- handler.name = "avg";
- handler.flags |= SOX_EFF_DEPRECATED;
- return &handler;
-}
-
-sox_effect_handler_t const * sox_pick_effect_fn(void)
-{
- static sox_effect_handler_t handler;
- handler = *sox_avg_effect_fn();
- handler.name = "pick";
- return &handler;
-}
-
static int oops_getopts(sox_effect_t * effp, int argc, char * * argv UNUSED)
{
char * args[] = {"1,1,-1,-1"};
--- a/src/mp3.c
+++ b/src/mp3.c
@@ -352,18 +352,8 @@
sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 decoding support");
return SOX_EOF;
}
-
-sox_ssize_t sox_mp3read(sox_format_t * ft, sox_sample_t *buf, sox_size_t samp)
-{
- sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 decoding support");
- return SOX_EOF;
-}
-
-int sox_mp3stopread(sox_format_t * ft)
-{
- sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 decoding support");
- return SOX_EOF;
-}
+#define sox_mp3read NULL
+#define sox_mp3stopread NULL
#endif /*HAVE_MAD_H*/
#ifdef HAVE_LAME_LAME_H
@@ -535,18 +525,8 @@
sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
return SOX_EOF;
}
-
-static sox_size_t sox_mp3write(sox_format_t * ft UNUSED, const sox_sample_t *buf UNUSED, sox_size_t samp UNUSED)
-{
- sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
- return 0;
-}
-
-static int sox_mp3stopwrite(sox_format_t * ft)
-{
- sox_fail_errno(ft,SOX_EOF,"SoX was compiled without MP3 encoding support");
- return SOX_EOF;
-}
+#define sox_mp3write NULL
+#define sox_mp3stopwrite NULL
#endif /* HAVE_LAME_LAME_H */
/* MP3 */
@@ -565,7 +545,7 @@
sox_mp3startwrite,
sox_mp3write,
sox_mp3stopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_mp3_format_fn(void);
--- a/src/nulfile.c
+++ b/src/nulfile.c
@@ -55,7 +55,7 @@
const sox_format_handler_t *sox_nul_format_fn(void)
{
- static const char *names[] = { "null", "nul"/* with -t; deprecated*/, NULL};
+ static const char *names[] = {"null", NULL};
static sox_format_handler_t handler = {
names, SOX_FILE_DEVICE | SOX_FILE_PHONY | SOX_FILE_NOSTDIO,
startread, read, 0, 0, write, 0, 0
--- a/src/oss.c
+++ b/src/oss.c
@@ -241,7 +241,7 @@
sox_ossstartwrite,
sox_rawwrite,
sox_rawstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_oss_format_fn(void);
--- a/src/rate.c
+++ /dev/null
@@ -1,19 +1,0 @@
-/*
- * libSoX rate change effect.
- *
- * Now obsolete, and implemented by resample. Name retained for
- * backwards compatibility.
- */
-
-#include "sox_i.h"
-
-sox_effect_handler_t const * sox_rate_effect_fn(void)
-{
- static sox_effect_handler_t handler;
- handler = *sox_resample_effect_fn();
- handler.name = "rate";
- handler.usage = NULL;
- handler.getopts = NULL;
- handler.flags |= SOX_EFF_DEPRECATED;
- return &handler;
-}
--- a/src/sox.c
+++ b/src/sox.c
@@ -811,7 +811,7 @@
free(text);
}
-static char *getoptstr = "+abc:defghilmnoqr:st:uv:wxABC:DLMNRSUV::X12348";
+static char *getoptstr = "+ac:fghimnoqr:st:uv:xABC:DLMNRSUV::X12348";
static struct option long_options[] =
{
@@ -971,7 +971,7 @@
repeatable_random = sox_true;
break;
- case 'e': case 'n':
+ case 'n':
return sox_true; /* i.e. is null file. */
break;
@@ -1018,11 +1018,11 @@
}
break;
- case '1': case 'b': f->signal.size = SOX_SIZE_BYTE; break;
- case '2': case 'w': f->signal.size = SOX_SIZE_16BIT; break;
- case '3': f->signal.size = SOX_SIZE_24BIT; break;
- case '4': case 'l': f->signal.size = SOX_SIZE_32BIT; break;
- case '8': case 'd': f->signal.size = SOX_SIZE_64BIT; break;
+ case '1': f->signal.size = SOX_SIZE_BYTE; break;
+ case '2': f->signal.size = SOX_SIZE_16BIT; break;
+ case '3': f->signal.size = SOX_SIZE_24BIT; break;
+ case '4': f->signal.size = SOX_SIZE_32BIT; break;
+ case '8': f->signal.size = SOX_SIZE_64BIT; break;
case 's': f->signal.encoding = SOX_ENCODING_SIGN2; break;
case 'u': f->signal.encoding = SOX_ENCODING_UNSIGNED; break;
--- a/src/soxconfig.h.cmake
+++ b/src/soxconfig.h.cmake
@@ -1,4 +1,4 @@
-#define PACKAGE_VERSION "14.0.2"
+#define PACKAGE_VERSION "14.1.0"
#cmakedefine EXTERNAL_GSM 1
#cmakedefine HAVE_ALSA 1
--- a/src/soxio.c
+++ b/src/soxio.c
@@ -87,15 +87,24 @@
*/
int sox_gettype(sox_format_t * ft, sox_bool is_file_extension)
{
- if (!ft->filetype)
+ if (!ft->filetype) {
sox_fail_errno(ft, SOX_EFMT, "unknown file type");
- else {
- ft->handler = sox_find_format(ft->filetype, is_file_extension);
- if (ft->handler)
- return SOX_SUCCESS;
+ return SOX_EFMT;
+ }
+ ft->handler = sox_find_format(ft->filetype, is_file_extension);
+ if (!ft->handler) {
sox_fail_errno(ft, SOX_EFMT, "unknown file type `%s'", ft->filetype);
+ return SOX_EFMT;
}
- return SOX_EFMT;
+ if (ft->mode == 'r' && !ft->handler->startread && !ft->handler->read) {
+ sox_fail_errno(ft, SOX_EFMT, "file type `%s' isn't readable", ft->filetype);
+ return SOX_EFMT;
+ }
+ if (ft->mode == 'w' && !ft->handler->startwrite && !ft->handler->write) {
+ sox_fail_errno(ft, SOX_EFMT, "file type `%s' isn't writable", ft->filetype);
+ return SOX_EFMT;
+ }
+ return SOX_SUCCESS;
}
/*
@@ -208,7 +217,7 @@
/* Let auto type do the work if user is not overriding. */
if (!filetype)
- ft->filetype = xstrdup("auto");
+ ft->filetype = xstrdup("magic");
else
ft->filetype = xstrdup(filetype);
--- a/src/sphere.c
+++ b/src/sphere.c
@@ -278,7 +278,7 @@
sox_spherestartwrite,
sox_spherewrite,
sox_spherestopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_sphere_format_fn(void);
--- a/src/sunaudio.c
+++ b/src/sunaudio.c
@@ -322,7 +322,7 @@
sox_sunstartwrite,
sox_rawwrite,
sox_rawstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_sunau_format_fn(void);
--- a/src/tx16w.c
+++ b/src/tx16w.c
@@ -378,7 +378,7 @@
sox_txwstartwrite,
sox_txwwrite,
sox_txwstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_txw_format_fn(void);
--- a/src/vibro.c
+++ /dev/null
@@ -1,48 +1,0 @@
-/*
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library. If not, write to the Free Software Foundation,
- * Fifth Floor, 51 Franklin Street, Boston, MA 02111-1301, USA.
- */
-
-/* Effect: "vibro" (= tremolo) (c) 2007 robs@users.sourceforge.net */
-
-#include "sox_i.h"
-
-static int getopts(sox_effect_t * effp, int n, char * * argv)
-{
- double speed, depth = 0.5;
- char dummy; /* To check for extraneous chars. */
- char offset[100];
- char * args[] = {"sine", "fmod", 0, 0};
-
- if (n < 1 || n > 2 ||
- sscanf(argv[0], "%lf %c", &speed, &dummy) != 1 || speed < 0 ||
- (n > 1 && sscanf(argv[1], "%lf %c", &depth, &dummy) != 1) ||
- depth <= 0 || depth > 1)
- return sox_usage(effp);
- args[2] = argv[0];
- sprintf(offset, "%g", 100 - 50 * depth);
- args[3] = offset;
- return sox_synth_effect_fn()->getopts(effp, array_length(args), args);
-}
-
-sox_effect_handler_t const * sox_vibro_effect_fn(void)
-{
- static sox_effect_handler_t handler;
- handler = *sox_synth_effect_fn();
- handler.name = "vibro";
- handler.usage = "speed [depth]";
- handler.getopts = getopts;
- handler.flags |= SOX_EFF_DEPRECATED;
- return &handler;
-}
--- a/src/voc.c
+++ b/src/voc.c
@@ -808,7 +808,7 @@
sox_vocstartwrite,
sox_vocwrite,
sox_vocstopwrite,
- sox_format_nothing_seek
+ NULL
};
const sox_format_handler_t *sox_voc_format_fn(void);
--- a/src/vox-fmt.c
+++ b/src/vox-fmt.c
@@ -26,7 +26,7 @@
sox_vox_start,
sox_vox_write,
sox_vox_stopwrite,
- sox_format_nothing_seek
+ NULL
};
return &handler;
}
--- a/src/xa.c
+++ b/src/xa.c
@@ -302,11 +302,6 @@
return SOX_EOF;
}
-static int sox_xaseek(sox_format_t * ft, sox_size_t offset)
-{
- return sox_format_nothing_seek(ft, offset);
-}
-
/* Maxis .xa */
static const char *xanames[] = {
"xa",
@@ -322,7 +317,7 @@
sox_xastartwrite,
sox_xawrite,
sox_xastopwrite,
- sox_xaseek
+ NULL
};
const sox_format_handler_t *sox_xa_format_fn(void);