Changeset 98a3887 for src/io/sink_apple_audio.c
- Timestamp:
- Jan 24, 2014, 5:09:50 PM (10 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:
- 5ab8e59
- Parents:
- 16dda03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_apple_audio.c
r16dda03 r98a3887 37 37 extern void freeAudioBufferList(AudioBufferList *bufferList); 38 38 extern CFURLRef getURLFromPath(const char * path); 39 char_t *getPrintableOSStatusError(char_t *str, OSStatus error); 39 40 40 41 #define MAX_SIZE 4096 // the maximum number of frames that can be written at a time … … 79 80 overwrite ? kAudioFileFlags_EraseFile : 0, &s->audioFile); 80 81 if (err) { 81 AUBIO_ERR("error when trying to create %s, in ExtAudioFileCreateWithURL, %d\n", s->path, (int)err); 82 char_t errorstr[20]; 83 AUBIO_ERR("sink_apple_audio: error when trying to create %s with " 84 "ExtAudioFileCreateWithURL (%s)\n", s->path, 85 getPrintableOSStatusError(errorstr, err)); 82 86 goto beach; 83 87 } 84 88 if (createAubioBufferList(&s->bufferList, s->channels, s->max_frames * s->channels)) { 85 AUBIO_ERR("error when creating buffer list for %s, out of memory? \n", s->path); 89 AUBIO_ERR("sink_apple_audio: error when creating buffer list for %s, " 90 "out of memory? \n", s->path); 86 91 goto beach; 87 92 } … … 115 120 116 121 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); 122 char_t errorstr[20]; 123 AUBIO_ERROR("sink_apple_audio: error while writing %s " 124 "in ExtAudioFileWriteAsync (%s), switching to sync\n", s->path, 125 getPrintableOSStatusError(errorstr, err)); 119 126 s->async = false; 120 127 } else { … … 126 133 127 134 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); 135 char_t errorstr[20]; 136 AUBIO_ERROR("sink_apple_audio: error while writing %s " 137 "in ExtAudioFileWrite (%s)\n", s->path, 138 getPrintableOSStatusError(errorstr, err)); 130 139 } 131 140 } … … 136 145 OSStatus err = noErr; 137 146 if (!s || !s->audioFile) { 138 AUBIO_ERR(" failed erasing sink_apple_audio\n");147 AUBIO_ERR("sink_apple_audio: failed erasing\n"); 139 148 return; 140 149 } 141 150 err = ExtAudioFileDispose(s->audioFile); 142 if (err) AUBIO_ERROR("error in ExtAudioFileDispose, %d\n", (int)err); 151 if (err) { 152 char_t errorstr[20]; 153 AUBIO_ERROR("sink_apple_audio: error while closing %s " 154 "in ExtAudioFileDispose (%s)\n", s->path, 155 getPrintableOSStatusError(errorstr, err)); 156 } 143 157 s->audioFile = NULL; 144 158 freeAudioBufferList(&s->bufferList);
Note: See TracChangeset
for help on using the changeset viewer.