ref: fe9c314544b14bef82c24c74699ad23c7b92f9e6
parent: c9cebe1cd399e9b3293a0133cb8c0a031019d36d
author: Paul Brossier <piem@piem.org>
date: Thu Oct 15 11:37:08 EDT 2009
src/temporal/resampler.{c,h}: use smpl_t, and convet that to a double for libsamplerate
--- 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 @@
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 */
--- a/src/temporal/resampler.h
+++ b/src/temporal/resampler.h
@@ -42,7 +42,7 @@
\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);