From 2d128dafb33d3724aef11a383d6220c856c5fb49 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 18 Sep 2016 12:54:10 +0200 Subject: [PATCH] src/effects/pitchshift.h: add aubio_pitchshift_get_latency --- src/effects/pitchshift.c | 8 ++++++++ src/effects/pitchshift.h | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/effects/pitchshift.c b/src/effects/pitchshift.c index f94c474c..ed22c3d6 100644 --- a/src/effects/pitchshift.c +++ b/src/effects/pitchshift.c @@ -97,6 +97,10 @@ del_aubio_pitchshift (aubio_pitchshift_t * p) AUBIO_FREE (p); } +uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * p) { + return rubberband_get_latency(p->rb); +} + uint_t aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * p, smpl_t pitchscale) { @@ -188,6 +192,10 @@ smpl_t aubio_pitchshift_get_transpose (aubio_pitchshift_t * o UNUSED) { return 0.; } +uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * o UNUSED) { + return 0.; +} + // end of dummy implementation #endif /* HAVE_RUBBERBAND */ diff --git a/src/effects/pitchshift.h b/src/effects/pitchshift.h index 40ffd53e..ee4d079d 100644 --- a/src/effects/pitchshift.h +++ b/src/effects/pitchshift.h @@ -67,6 +67,15 @@ void del_aubio_pitchshift (aubio_pitchshift_t * o); aubio_pitchshift_t *new_aubio_pitchshift (const char_t * method, smpl_t pitchscale, uint_t hop_size, uint_t samplerate); +/** get the latency of the pitch shifting object, in samples + + \param o pitch shifting object as returned by ::new_aubio_pitchshift() + + \return latency of the pitch shifting object in samples + +*/ +uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * o); + /** set the pitch scale of the pitch shifting object \param o pitch shifting object as returned by new_aubio_pitchshift() -- 2.11.0