src/io/source.h: add get_samplerate
authorPaul Brossier <piem@piem.org>
Fri, 27 Jul 2012 16:39:05 +0000 (10:39 -0600)
committerPaul Brossier <piem@piem.org>
Fri, 27 Jul 2012 16:39:05 +0000 (10:39 -0600)
src/io/source.c
src/io/source.h

index 9ed3bf7e7d3a0582062b2a1be4cd94fcf531099a..b4da594bfa1b972f540bb5bede2cc682d2a9a650 100644 (file)
@@ -71,3 +71,13 @@ void del_aubio_source(aubio_source_t * s) {
   AUBIO_FREE(s);
 }
 
+uint_t aubio_source_get_samplerate(aubio_source_t * s) {
+#ifdef __APPLE__
+  return aubio_source_apple_audio_get_samplerate((aubio_source_apple_audio_t *)s->source);
+#else /* __APPLE__ */
+#if HAVE_SNDFILE
+  return aubio_source_sndfile_get_samplerate((aubio_source_sndfile_t *)s->source);
+#endif /* HAVE_SNDFILE */
+#endif /* __APPLE__ */
+}
+
index 2500c215c021fdbd86fef345f09b6b9924d738cf..e607312702277f773dcf0cb2b881ed723eacf57f 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
 typedef struct _aubio_source_t aubio_source_t;
 aubio_source_t * new_aubio_source(char_t * uri, uint_t samplerate, uint_t hop_size);
 void aubio_source_do(aubio_source_t * s, fvec_t * read_data, uint_t * read);
+uint_t aubio_source_get_samplerate(aubio_source_t * s);
 void del_aubio_source(aubio_source_t * s);
 
 #ifdef __cplusplus