version 1.21, 2011/10/14 10:54:12 |
version 1.22, 2012/04/11 06:05:43 |
|
|
}; |
}; |
|
|
int |
int |
wav_readfmt(int fd, unsigned csize, struct aparams *par, short **map) |
wav_readfmt(int fd, unsigned int csize, struct aparams *par, short **map) |
{ |
{ |
struct wavfmt fmt; |
struct wavfmt fmt; |
unsigned nch, cmax, rate, bits, bps, enc; |
unsigned int nch, cmax, rate, bits, bps, enc; |
|
|
if (csize < WAV_FMT_SIZE) { |
if (csize < WAV_FMT_SIZE) { |
warnx("%u: bugus format chunk size", csize); |
warnx("%u: bugus format chunk size", csize); |
|
|
{ |
{ |
struct wavriff riff; |
struct wavriff riff; |
struct wavchunk chunk; |
struct wavchunk chunk; |
unsigned csize, rsize, pos = 0; |
unsigned int csize, rsize, pos = 0; |
int fmt_done = 0; |
int fmt_done = 0; |
|
|
if (lseek(fd, 0, SEEK_SET) < 0) { |
if (lseek(fd, 0, SEEK_SET) < 0) { |
|
|
int |
int |
wav_writehdr(int fd, struct aparams *par, off_t *startpos, off_t datasz) |
wav_writehdr(int fd, struct aparams *par, off_t *startpos, off_t datasz) |
{ |
{ |
unsigned nch = par->cmax - par->cmin + 1; |
unsigned int nch = par->cmax - par->cmin + 1; |
struct { |
struct { |
struct wavriff riff; |
struct wavriff riff; |
struct wavchunk fmt_hdr; |
struct wavchunk fmt_hdr; |