int i,j, channels = f->channels;
int nsamples = frames*channels;
int aread;
- float *pread;
+ smpl_t *pread;
/* allocate data for de/interleaving reallocated when needed. */
if (nsamples >= f->size) {
/* de-interleaving data */
for (i=0; i<channels; i++) {
- pread = (float *)fvec_get_channel(read,i);
+ pread = (smpl_t *)fvec_get_channel(read,i);
for (j=0; j<aread; j++) {
- pread[j] = f->tmpdata[channels*j+i];
+ pread[j] = (smpl_t)f->tmpdata[channels*j+i];
}
}
return aread;
sf_count_t written_frames = 0;
int i, j, channels = f->channels;
int nsamples = channels*frames;
- float *pwrite;
+ smpl_t *pwrite;
/* allocate data for de/interleaving reallocated when needed. */
if (nsamples >= f->size) {
/* interleaving data */
for (i=0; i<channels; i++) {
- pwrite = (float *)fvec_get_channel(write,i);
+ pwrite = (smpl_t *)fvec_get_channel(write,i);
for (j=0; j<frames; j++) {
- f->tmpdata[channels*j+i] = pwrite[j];
+ f->tmpdata[channels*j+i] = (float)pwrite[j];
}
}
written_frames = sf_write_float (f->handle, f->tmpdata, nsamples);