- Timestamp:
- Nov 13, 2013, 1:26:33 PM (11 years ago)
- 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:
- a4c1e86
- Parents:
- d3066e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_apple_audio.c
rd3066e2 r4bc92c0 49 49 AudioBufferList bufferList; 50 50 ExtAudioFileRef audioFile; 51 bool async; 51 52 }; 52 53 … … 57 58 s->path = uri; 58 59 s->max_frames = MAX_SIZE; 60 s->async = true; 59 61 60 62 AudioStreamBasicDescription clientFormat; … … 94 96 OSStatus err = noErr; 95 97 UInt32 c, v; 96 bool async = true;97 98 short *data = (short*)s->bufferList.mBuffers[0].mData; 98 99 if (write > s->max_frames) { … … 110 111 } 111 112 } 112 if ( async) {113 if (s->async) { 113 114 err = ExtAudioFileWriteAsync(s->audioFile, write, &s->bufferList); 114 if (err) { AUBIO_ERROR("error in ExtAudioFileWriteAsync, %d\n", (int)err); } 115 116 if (err) { 117 AUBIO_ERROR("in aubio_sink_apple_audio_do, writing %s\n", s->path); 118 AUBIO_ERROR("ExtAudioFileWriteAsync failed with %d, switching to sync\n", (int)err); 119 s->async = false; 120 } else { 121 return; 122 } 123 115 124 } else { 116 125 err = ExtAudioFileWrite(s->audioFile, write, &s->bufferList); 117 if (err) { AUBIO_ERROR("error in ExtAudioFileWrite, %d\n", (int)err); } 126 127 if (err) { 128 AUBIO_ERROR("in aubio_sink_apple_audio_do, writing %s\n", s->path); 129 AUBIO_ERROR("ExtAudioFileWrite failed with %d, aborting\n", (int)err); 130 } 118 131 } 119 132 return;
Note: See TracChangeset
for help on using the changeset viewer.