Changeset a41b1ef
- Timestamp:
- Apr 25, 2016, 4:26:39 PM (9 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:
- b1d2be8
- Parents:
- 8bffcff
- Location:
- src/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_apple_audio.c
r8bffcff ra41b1ef 312 312 } 313 313 // check if we are not seeking out of the file 314 SInt64 fileLengthFrames = 0; 315 UInt32 propSize = sizeof(fileLengthFrames); 316 ExtAudioFileGetProperty(s->audioFile, 317 kExtAudioFileProperty_FileLengthFrames, &propSize, &fileLengthFrames); 314 uint_t fileLengthFrames = aubio_source_apple_audio_get_duration(s); 318 315 // compute position in the source file, before resampling 319 316 smpl_t ratio = s->source_samplerate * 1. / s->samplerate; … … 364 361 } 365 362 363 uint_t aubio_source_apple_audio_get_duration(const aubio_source_apple_audio_t * s) { 364 SInt64 fileLengthFrames = 0; 365 UInt32 propSize = sizeof(fileLengthFrames); 366 OSStatus err = ExtAudioFileGetProperty(s->audioFile, 367 kExtAudioFileProperty_FileLengthFrames, &propSize, &fileLengthFrames); 368 if (err) { 369 char_t errorstr[20]; 370 AUBIO_ERROR("source_apple_audio: Failed getting %s duration, " 371 "error in ExtAudioFileGetProperty (%s)\n", s->path, 372 getPrintableOSStatusError(errorstr, err)); 373 return err; 374 } 375 return (uint_t)fileLengthFrames; 376 } 377 366 378 #endif /* HAVE_SOURCE_APPLE_AUDIO */ -
src/io/source_apple_audio.h
r8bffcff ra41b1ef 110 110 /** 111 111 112 get the duration of source object, in frames 113 114 \param s source object, created with ::new_aubio_source_apple_audio 115 \return number of frames in file 116 117 */ 118 uint_t aubio_source_apple_audio_get_duration(const aubio_source_apple_audio_t * s); 119 120 /** 121 112 122 seek source object 113 123
Note: See TracChangeset
for help on using the changeset viewer.