From: Paul Brossier Date: Sat, 24 Nov 2018 17:31:42 +0000 (+0100) Subject: [tempo] fix delay_ms methods X-Git-Tag: 0.4.9~164^2 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=ef0a430fdb65d2f8eaf3b92e47eaece4255497d8;p=aubio.git [tempo] fix delay_ms methods --- diff --git a/src/tempo/tempo.c b/src/tempo/tempo.c index 4b91c9d6..5698b2bb 100644 --- a/src/tempo/tempo.c +++ b/src/tempo/tempo.c @@ -128,8 +128,7 @@ uint_t aubio_tempo_set_delay_s(aubio_tempo_t * o, smpl_t delay) { } uint_t aubio_tempo_set_delay_ms(aubio_tempo_t * o, smpl_t delay) { - o->delay = 1000. * delay * o->samplerate; - return AUBIO_OK; + return aubio_tempo_set_delay_s(o, delay / 1000.); } uint_t aubio_tempo_get_delay(aubio_tempo_t * o) { @@ -141,7 +140,7 @@ smpl_t aubio_tempo_get_delay_s(aubio_tempo_t * o) { } smpl_t aubio_tempo_get_delay_ms(aubio_tempo_t * o) { - return o->delay / (smpl_t)(o->samplerate) / 1000.; + return aubio_tempo_get_delay_s(o) * 1000.; } uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence) {