rate: add some sanity checking
[sox.git] / src / vox.c
blob4943acbce95605d106ad78569c200f23b7399dde
1 /* libSoX file format handler for Dialogic/Oki ADPCM VOX files.
3 * Copyright 1991-2007 Tony Seebregts And Sundry Contributors
5 * This source code is freely redistributable and may be used for any
6 * purpose. This copyright notice must be maintained.
8 * Tony Seebregts And Sundry Contributors are not responsible for the
9 * consequences of using this software.
12 #include "sox_i.h"
13 #include "vox.h"
14 #include "adpcms.h"
16 /* .vox doesn't need any private state over and above adpcm_io_t *, so
17 just have simple wrappers that pass it on directly. */
19 int lsx_vox_start(sox_format_t * ft)
21 return lsx_adpcm_oki_start(ft, (adpcm_io_t *)ft->priv);
24 int lsx_ima_start(sox_format_t * ft)
26 return lsx_adpcm_ima_start(ft, (adpcm_io_t *)ft->priv);
29 size_t lsx_vox_read(sox_format_t * ft, sox_sample_t *buffer, size_t len)
31 return lsx_adpcm_read(ft, (adpcm_io_t *)ft->priv, buffer, len);
34 int lsx_vox_stopread(sox_format_t * ft)
36 return lsx_adpcm_stopread(ft, (adpcm_io_t *)ft->priv);
39 size_t lsx_vox_write(sox_format_t * ft, const sox_sample_t *buffer, size_t length)
41 return lsx_adpcm_write(ft, (adpcm_io_t *)ft->priv, buffer, length);
44 int lsx_vox_stopwrite(sox_format_t * ft)
46 return lsx_adpcm_stopwrite(ft, (adpcm_io_t *)ft->priv);