Changeset fc117d0 for src


Ignore:
Timestamp:
Feb 11, 2013, 11:06:28 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:
050a8f3
Parents:
5314432 (diff), 88fc249 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge from develop

Location:
src
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • src/aubio.h

    r5314432 rfc117d0  
    11/*
    2   Copyright (C) 2003-2009 Paul Brossier <piem@aubio.org>
     2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
    33
    44  This file is part of aubio.
  • src/io/sink.c

    r5314432 rfc117d0  
    4545#endif /* HAVE_SNDFILE */
    4646#endif /* __APPLE__ */
    47   AUBIO_ERROR("failed creating aubio sink with %s", uri);
     47  AUBIO_ERROR("failed creating aubio sink with %s\n", uri);
    4848  AUBIO_FREE(s);
    4949  return NULL;
  • src/io/sink_apple_audio.c

    r5314432 rfc117d0  
    5353aubio_sink_apple_audio_t * new_aubio_sink_apple_audio(char_t * uri, uint_t samplerate) {
    5454  aubio_sink_apple_audio_t * s = AUBIO_NEW(aubio_sink_apple_audio_t);
    55   s->samplerate;
     55  s->samplerate = samplerate;
    5656  s->channels = 1;
    5757  s->path = uri;
     
    5959
    6060  AudioStreamBasicDescription clientFormat;
    61   UInt32 propSize = sizeof(clientFormat);
    6261  memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));
    6362  clientFormat.mFormatID         = kAudioFormatLinearPCM;
     
    7877     overwrite ? kAudioFileFlags_EraseFile : 0, &s->audioFile);
    7978  if (err) {
    80     AUBIO_ERR("error when trying to access %s, in ExtAudioFileOpenURL, %d\n", s->path, (int)err);
     79    AUBIO_ERR("error when trying to create %s, in ExtAudioFileCreateWithURL, %d\n", s->path, (int)err);
    8180    goto beach;
    8281  }
  • src/io/source.c

    r5314432 rfc117d0  
    4545#endif /* HAVE_SNDFILE */
    4646#endif /* __APPLE__ */
    47   AUBIO_ERROR("failed creating aubio source with %s", uri);
     47  AUBIO_ERROR("failed creating aubio source with %s\n", uri);
    4848  AUBIO_FREE(s);
    4949  return NULL;
  • src/io/source.h

    r5314432 rfc117d0  
    3838void del_aubio_source(aubio_source_t * s);
    3939
     40uint_t aubio_source_get_samplerate(aubio_source_t * s);
     41
    4042#ifdef __cplusplus
    4143}
  • src/io/source_apple_audio.c

    r5314432 rfc117d0  
    5555
    5656  s->path = path;
    57   s->samplerate = samplerate;
    5857  s->block_size = block_size;
    5958  s->channels = 1;
     
    6160  OSStatus err = noErr;
    6261  UInt32 propSize;
    63 
    64   AudioStreamBasicDescription clientFormat;
    65   propSize = sizeof(clientFormat);
    66   memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));
    67   clientFormat.mFormatID         = kAudioFormatLinearPCM;
    68   clientFormat.mSampleRate       = (Float64)(s->samplerate);
    69   clientFormat.mFormatFlags      = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
    70   clientFormat.mChannelsPerFrame = s->channels;
    71   clientFormat.mBitsPerChannel   = sizeof(short) * 8;
    72   clientFormat.mFramesPerPacket  = 1;
    73   clientFormat.mBytesPerFrame    = clientFormat.mBitsPerChannel * clientFormat.mChannelsPerFrame / 8;
    74   clientFormat.mBytesPerPacket   = clientFormat.mFramesPerPacket * clientFormat.mBytesPerFrame;
    75   clientFormat.mReserved         = 0;
    7662
    7763  // open the resource url
     
    9076  if (err) { AUBIO_ERROR("error in ExtAudioFileGetProperty, %d\n", (int)err); goto beach;}
    9177
    92   if (s->samplerate == 1) {
    93     clientFormat.mSampleRate = fileFormat.mSampleRate;
    94     s->samplerate = fileFormat.mSampleRate;
     78  if (samplerate == 0) {
     79    samplerate = fileFormat.mSampleRate;
     80    //AUBIO_DBG("sampling rate set to 0, automagically adjusting to %d\n", samplerate);
    9581  }
     82  s->samplerate = samplerate;
     83
     84  AudioStreamBasicDescription clientFormat;
     85  propSize = sizeof(clientFormat);
     86  memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription));
     87  clientFormat.mFormatID         = kAudioFormatLinearPCM;
     88  clientFormat.mSampleRate       = (Float64)(s->samplerate);
     89  clientFormat.mFormatFlags      = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
     90  clientFormat.mChannelsPerFrame = s->channels;
     91  clientFormat.mBitsPerChannel   = sizeof(short) * 8;
     92  clientFormat.mFramesPerPacket  = 1;
     93  clientFormat.mBytesPerFrame    = clientFormat.mBitsPerChannel * clientFormat.mChannelsPerFrame / 8;
     94  clientFormat.mBytesPerPacket   = clientFormat.mFramesPerPacket * clientFormat.mBytesPerFrame;
     95  clientFormat.mReserved         = 0;
    9696
    9797  // set the client format description
  • src/io/source_apple_audio.h

    r5314432 rfc117d0  
    2828void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s);
    2929
     30uint_t aubio_source_apple_audio_get_samplerate(aubio_source_apple_audio_t * s);
     31
    3032#endif /* _AUBIO_SOURCE_APPLE_AUDIO_H */
  • src/io/source_sndfile.c

    r5314432 rfc117d0  
    7070
    7171  s->hop_size = hop_size;
    72   s->samplerate = samplerate;
    7372  s->channels = 1;
    7473  s->path = path;
     
    9089  s->input_format     = sfinfo.format;
    9190
    92   if (s->samplerate == 1) s->samplerate = s->input_samplerate;
    93 
     91  if (samplerate == 0) {
     92    samplerate = s->input_samplerate;
     93    //AUBIO_DBG("sampling rate set to 0, automagically adjusting to %d\n", samplerate);
     94  }
     95  s->samplerate = samplerate;
    9496  /* compute input block size required before resampling */
    9597  s->ratio = s->samplerate/(float)s->input_samplerate;
     
    192194}
    193195
     196uint_t aubio_source_sndfile_get_samplerate(aubio_source_sndfile_t * s) {
     197  return s->samplerate;
     198}
     199
    194200#endif /* HAVE_SNDFILE */
  • src/io/source_sndfile.h

    r5314432 rfc117d0  
    2828void del_aubio_source_sndfile(aubio_source_sndfile_t * s);
    2929
     30uint_t aubio_source_sndfile_get_samplerate(aubio_source_sndfile_t * s);
     31
    3032#endif /* _AUBIO_SOURCE_SNDFILE_H */
  • src/tempo/beattracking.c

    r5314432 rfc117d0  
    136136  smpl_t beat;                  // beat position
    137137  smpl_t bp;                    // beat period
    138   uint_t a; sint_t b;           // used to build shift invariant comb filterbank
     138  uint_t a, b;                  // used to build shift invariant comb filterbank
    139139  uint_t kmax;                  // number of elements used to find beat phase
    140140
     
    160160  for (i = 1; i < laglen - 1; i++) {
    161161    for (a = 1; a <= numelem; a++) {
    162       for (b = (1 - a); b < (sint_t)a; b++) {
    163         bt->acfout->data[i] += bt->acf->data[a * (i + 1) + b - 1]
     162      for (b = 1; b < 2 * a; b++) {
     163        bt->acfout->data[i] += bt->acf->data[i * a + b - 1]
    164164            * 1. / (2. * a - 1.);
    165165      }
     
    276276aubio_beattracking_checkstate (aubio_beattracking_t * bt)
    277277{
    278   uint_t i, j, a; sint_t b;
     278  uint_t i, j, a, b;
    279279  uint_t flagconst = 0;
    280280  sint_t counter = bt->counter;
     
    300300    for (i = 1; i < laglen - 1; i++) {
    301301      for (a = 1; a <= bt->timesig; a++) {
    302         for (b = (1 - a); b < (sint_t)a; b++) {
    303           acfout->data[i] += acf->data[a * (i + 1) + b - 1];
     302        for (b = 1; b < 2 * a; b++) {
     303          acfout->data[i] += acf->data[i * a + b - 1];
    304304        }
    305305      }
  • src/temporal/resampler.c

    r5314432 rfc117d0  
    4343  int error = 0;
    4444  s->stat = src_new (type, 1, &error);  /* only one channel */
     45  if (error) {
     46    AUBIO_ERR ("Failed creating resampler: %s\n", src_strerror (error));
     47    del_aubio_resampler(s);
     48    return NULL;
     49  }
    4550  s->proc = AUBIO_NEW (SRC_DATA);
    46   if (error)
    47     AUBIO_ERR ("%s\n", src_strerror (error));
    4851  s->ratio = ratio;
    4952  return s;
     
    5356del_aubio_resampler (aubio_resampler_t * s)
    5457{
    55   src_delete (s->stat);
     58  if (s->stat) src_delete (s->stat);
    5659  AUBIO_FREE (s->proc);
    5760  AUBIO_FREE (s);
  • src/wscript_build

    r5314432 rfc117d0  
    2525# install headers, except _priv.h ones
    2626ctx.install_files('${PREFIX}/include/aubio/',
    27         ctx.path.ant_glob('**/*.h',
    28         exclude = ['_priv.h', 'config.h']),
    29         relative_trick=True)
     27
     28    ctx.path.ant_glob('**/*.h', excl = ['**_priv.h', 'config.h']),
     29    relative_trick=True)
Note: See TracChangeset for help on using the changeset viewer.