Changeset afbd7e7 for src/io


Ignore:
Timestamp:
Jul 14, 2012, 1:33:45 AM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
9b1e101
Parents:
4722e63
Message:

src/io/source_sndfile.{c,h}: added sndfile source

Location:
src/io
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/source.c

    r4722e63 rafbd7e7  
    2626#include "io/source_apple_audio_file.h"
    2727#endif /* __APPLE__ */
     28#ifdef HAVE_SNDFILE
     29#include "io/source_sndfile.h"
     30#endif
    2831
    2932struct _aubio_source_t {
     
    3134};
    3235
    33 aubio_source_t * new_aubio_source(char_t * uri, uint_t hop_size, uint_t samplerate) {
     36aubio_source_t * new_aubio_source(char_t * uri, uint_t samplerate, uint_t hop_size) {
    3437  aubio_source_t * s = AUBIO_NEW(aubio_source_t);
    3538#ifdef __APPLE__
    36   s->source= (void *)new_aubio_source_apple_audio(uri, hop_size, samplerate);
     39  s->source= (void *)new_aubio_source_apple_audio(uri, samplerate, hop_size);
     40  if (s->source) return s;
     41#else /* __APPLE__ */
     42#if HAVE_SNDFILE
     43  s->source= (void *)new_aubio_source_sndfile(uri, samplerate, hop_size);
     44  if (s->source) return s;
     45#endif /* HAVE_SNDFILE */
    3746#endif /* __APPLE__ */
    3847  if (s->source == NULL) return NULL;
    39   return s;
    4048}
    4149
     
    4351#ifdef __APPLE__
    4452  aubio_source_apple_audio_do((aubio_source_apple_audio_t *)s->source, data, read);
     53#else /* __APPLE__ */
     54#if HAVE_SNDFILE
     55  aubio_source_sndfile_do((aubio_source_sndfile_t *)s->source, data, read);
     56#endif /* HAVE_SNDFILE */
    4557#endif /* __APPLE__ */
    4658}
     
    4961#ifdef __APPLE__
    5062  del_aubio_source_apple_audio((aubio_source_apple_audio_t *)s->source);
     63#else /* __APPLE__ */
     64#if HAVE_SNDFILE
     65  del_aubio_source_sndfile((aubio_source_sndfile_t *)s->source);
     66#endif /* HAVE_SNDFILE */
    5167#endif /* __APPLE__ */
    5268  AUBIO_FREE(s);
Note: See TracChangeset for help on using the changeset viewer.