version 1.2, 2008/11/26 00:33:40 |
version 1.3, 2009/01/23 17:38:15 |
|
|
* max data of a .wav file. The total file size must be smaller than |
* max data of a .wav file. The total file size must be smaller than |
* 2^31, and we also have to leave some space for the headers (around 40 |
* 2^31, and we also have to leave some space for the headers (around 40 |
* bytes) |
* bytes) |
*/ |
*/ |
#define WAV_DATAMAX (0x7fff0000) |
#define WAV_DATAMAX (0x7fff0000) |
|
|
struct fileops wav_ops = { |
struct fileops wav_ops = { |
|
|
f = (struct wav *)pipe_new(ops, fd, name); |
f = (struct wav *)pipe_new(ops, fd, name); |
if (hdr == HDR_WAV) { |
if (hdr == HDR_WAV) { |
par->le = 1; |
par->le = 1; |
par->sig = (par->bits <= 8) ? 0 : 1; |
par->sig = (par->bits <= 8) ? 0 : 1; |
par->bps = (par->bits + 7) / 8; |
par->bps = (par->bits + 7) / 8; |
if (!wav_writehdr(f->pipe.fd, par)) |
if (!wav_writehdr(f->pipe.fd, par)) |
exit(1); |
exit(1); |
|
|
{ |
{ |
struct wav *f = (struct wav *)file; |
struct wav *f = (struct wav *)file; |
unsigned n; |
unsigned n; |
|
|
if (f->wbytes >= 0 && count > f->wbytes) { |
if (f->wbytes >= 0 && count > f->wbytes) { |
count = f->wbytes; /* wbytes fits in count */ |
count = f->wbytes; /* wbytes fits in count */ |
if (count == 0) { |
if (count == 0) { |