Changeset fc117d0 for src/io


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/io
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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 */
Note: See TracChangeset for help on using the changeset viewer.