From: Paul Brossier Date: Thu, 15 Oct 2009 13:37:08 +0000 (+0200) Subject: src/temporal/resampler.{c,h}: use smpl_t, and convet that to a double for libsamplerate X-Git-Tag: bzr2git~136 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fe9c314544b14bef82c24c74699ad23c7b92f9e6;p=aubio.git src/temporal/resampler.{c,h}: use smpl_t, and convet that to a double for libsamplerate --- diff --git a/src/temporal/resampler.c b/src/temporal/resampler.c index 2383be25..572e0bf6 100644 --- a/src/temporal/resampler.c +++ b/src/temporal/resampler.c @@ -30,11 +30,11 @@ struct _aubio_resampler_t { SRC_DATA *proc; SRC_STATE *stat; - float ratio; + smpl_t ratio; uint_t type; }; -aubio_resampler_t * new_aubio_resampler(float ratio, uint_t type) { +aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type) { aubio_resampler_t * s = AUBIO_NEW(aubio_resampler_t); int error = 0; s->stat = src_new (type, 1, &error) ; /* only one channel */ @@ -55,7 +55,7 @@ void aubio_resampler_do (aubio_resampler_t *s, uint_t i ; s->proc->input_frames = input->length; s->proc->output_frames = output->length; - s->proc->src_ratio = s->ratio; + s->proc->src_ratio = (double)s->ratio; for (i = 0 ; i< input->channels; i++) { /* make SRC_PROC data point to input outputs */ diff --git a/src/temporal/resampler.h b/src/temporal/resampler.h index 57744886..95f121e7 100644 --- a/src/temporal/resampler.h +++ b/src/temporal/resampler.h @@ -42,7 +42,7 @@ typedef struct _aubio_resampler_t aubio_resampler_t; \param type libsamplerate resampling type */ -aubio_resampler_t * new_aubio_resampler(float ratio, uint_t type); +aubio_resampler_t * new_aubio_resampler(smpl_t ratio, uint_t type); /** delete resampler object */ void del_aubio_resampler(aubio_resampler_t *s);