shithub: aubio

Download patch

ref: d00e22308e1b4b3bd36da7de94c169298f9c8fef
parent: 01e158db406826cfd9d667139a5643393bd5accb
author: Paul Brossier <piem@piem.org>
date: Fri Jul 27 06:39:05 EDT 2012

src/io/source.h: add get_samplerate

--- a/src/io/source.c
+++ b/src/io/source.c
@@ -71,3 +71,13 @@
   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__ */
+}
+
--- a/src/io/source.h
+++ b/src/io/source.h
@@ -34,6 +34,7 @@
 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