From: Paul Brossier Date: Fri, 27 Jul 2012 16:39:05 +0000 (-0600) Subject: src/io/source.h: add get_samplerate X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d00e22308e1b4b3bd36da7de94c169298f9c8fef;p=aubio.git src/io/source.h: add get_samplerate --- diff --git a/src/io/source.c b/src/io/source.c index 9ed3bf7e..b4da594b 100644 --- a/src/io/source.c +++ b/src/io/source.c @@ -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__ */ +} + diff --git a/src/io/source.h b/src/io/source.h index 2500c215..e6073127 100644 --- a/src/io/source.h +++ b/src/io/source.h @@ -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