From d69e37d91c59ca538a17455ea6b5733de3ef300c Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 25 Sep 2009 03:54:05 +0200 Subject: [PATCH] ext/sndfileio.c: convert data from and to float if smpl_t != float --- ext/sndfileio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/sndfileio.c b/ext/sndfileio.c index fd37bab3..ce4dc689 100644 --- a/ext/sndfileio.c +++ b/ext/sndfileio.c @@ -128,7 +128,7 @@ int aubio_sndfile_read(aubio_sndfile_t * f, int frames, fvec_t * read) { 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) { @@ -148,9 +148,9 @@ int aubio_sndfile_read(aubio_sndfile_t * f, int frames, fvec_t * read) { /* de-interleaving data */ for (i=0; itmpdata[channels*j+i]; + pread[j] = (smpl_t)f->tmpdata[channels*j+i]; } } return aread; @@ -163,7 +163,7 @@ int aubio_sndfile_write(aubio_sndfile_t * f, int frames, fvec_t * write) { 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) { @@ -178,9 +178,9 @@ int aubio_sndfile_write(aubio_sndfile_t * f, int frames, fvec_t * write) { /* interleaving data */ for (i=0; itmpdata[channels*j+i] = pwrite[j]; + f->tmpdata[channels*j+i] = (float)pwrite[j]; } } written_frames = sf_write_float (f->handle, f->tmpdata, nsamples); -- 2.26.2