Ignore:
Timestamp:
Feb 11, 2013, 11:06:28 AM (11 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

File:
1 edited

Legend:

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