src/effects/pitchshift.h: add aubio_pitchshift_get_latency
authorPaul Brossier <piem@piem.org>
Sun, 18 Sep 2016 10:54:10 +0000 (12:54 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 18 Sep 2016 10:54:10 +0000 (12:54 +0200)
src/effects/pitchshift.c
src/effects/pitchshift.h

index f94c474..ed22c3d 100644 (file)
@@ -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 */
index 40ffd53..ee4d079 100644 (file)
@@ -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()