Changeset afbd7e7


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

Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/aubio.h

    r4722e63 rafbd7e7  
    175175#include "onset/peakpicker.h"
    176176#include "tempo/tempo.h"
     177#include "io/sndfileio.h"
    177178#include "io/source.h"
     179#include "io/source_sndfile.h"
     180#include "io/source_apple_audio.h"
    178181#include "io/sink.h"
    179 #include "io/source_apple_audio.h"
    180182
    181183#if AUBIO_UNSTABLE
  • 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);
  • src/wscript_build

    r4722e63 rafbd7e7  
    1010if 'HAVE_SAMPLERATE':
    1111  uselib += ['SAMPLERATE']
     12
     13if 'HAVE_SNDFILE':
     14  uselib += ['SNDFILE']
    1215
    1316# build libaubio
  • tests/src/io/test-source_apple_audio_file.c

    r4722e63 rafbd7e7  
    2222  del_aubio_source_apple_audio(s);
    2323#else
    24   fprintf(stderr, "was not compiled with aubio_source_apple_audio");
     24  fprintf(stderr, "ERR: aubio was not compiled with aubio_source_apple_audio\n");
    2525#endif /* __APPLE__ */
    2626  return 0;
Note: See TracChangeset for help on using the changeset viewer.