1 /* libSoX file format handler for Dialogic/Oki ADPCM VOX files.
2 *
3 * Copyright 1991-2007 Tony Seebregts And Sundry Contributors
4 *
5 * This source code is freely redistributable and may be used for any
6 * purpose. This copyright notice must be maintained.
7 *
8 * Tony Seebregts And Sundry Contributors are not responsible for the
9 * consequences of using this software.
10 */
11
12 #include "sox_i.h"
13 #include "vox.h"
14 #include "adpcms.h"
15
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. */
18
lsx_vox_start(sox_format_t * ft)19 int lsx_vox_start(sox_format_t * ft)
20 {
21 return lsx_adpcm_oki_start(ft, (adpcm_io_t *)ft->priv);
22 }
23
lsx_ima_start(sox_format_t * ft)24 int lsx_ima_start(sox_format_t * ft)
25 {
26 return lsx_adpcm_ima_start(ft, (adpcm_io_t *)ft->priv);
27 }
28
lsx_vox_read(sox_format_t * ft,sox_sample_t * buffer,size_t len)29 size_t lsx_vox_read(sox_format_t * ft, sox_sample_t *buffer, size_t len)
30 {
31 return lsx_adpcm_read(ft, (adpcm_io_t *)ft->priv, buffer, len);
32 }
33
lsx_vox_stopread(sox_format_t * ft)34 int lsx_vox_stopread(sox_format_t * ft)
35 {
36 return lsx_adpcm_stopread(ft, (adpcm_io_t *)ft->priv);
37 }
38
lsx_vox_write(sox_format_t * ft,const sox_sample_t * buffer,size_t length)39 size_t lsx_vox_write(sox_format_t * ft, const sox_sample_t *buffer, size_t length)
40 {
41 return lsx_adpcm_write(ft, (adpcm_io_t *)ft->priv, buffer, length);
42 }
43
lsx_vox_stopwrite(sox_format_t * ft)44 int lsx_vox_stopwrite(sox_format_t * ft)
45 {
46 return lsx_adpcm_stopwrite(ft, (adpcm_io_t *)ft->priv);
47 }
48