- Timestamp:
- Feb 11, 2013, 11:06:28 AM (12 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:
- 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. - Location:
- src/io
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink.c
r5314432 rfc117d0 45 45 #endif /* HAVE_SNDFILE */ 46 46 #endif /* __APPLE__ */ 47 AUBIO_ERROR("failed creating aubio sink with %s ", uri);47 AUBIO_ERROR("failed creating aubio sink with %s\n", uri); 48 48 AUBIO_FREE(s); 49 49 return NULL; -
src/io/sink_apple_audio.c
r5314432 rfc117d0 53 53 aubio_sink_apple_audio_t * new_aubio_sink_apple_audio(char_t * uri, uint_t samplerate) { 54 54 aubio_sink_apple_audio_t * s = AUBIO_NEW(aubio_sink_apple_audio_t); 55 s->samplerate ;55 s->samplerate = samplerate; 56 56 s->channels = 1; 57 57 s->path = uri; … … 59 59 60 60 AudioStreamBasicDescription clientFormat; 61 UInt32 propSize = sizeof(clientFormat);62 61 memset(&clientFormat, 0, sizeof(AudioStreamBasicDescription)); 63 62 clientFormat.mFormatID = kAudioFormatLinearPCM; … … 78 77 overwrite ? kAudioFileFlags_EraseFile : 0, &s->audioFile); 79 78 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); 81 80 goto beach; 82 81 } -
src/io/source.c
r5314432 rfc117d0 45 45 #endif /* HAVE_SNDFILE */ 46 46 #endif /* __APPLE__ */ 47 AUBIO_ERROR("failed creating aubio source with %s ", uri);47 AUBIO_ERROR("failed creating aubio source with %s\n", uri); 48 48 AUBIO_FREE(s); 49 49 return NULL; -
src/io/source.h
r5314432 rfc117d0 38 38 void del_aubio_source(aubio_source_t * s); 39 39 40 uint_t aubio_source_get_samplerate(aubio_source_t * s); 41 40 42 #ifdef __cplusplus 41 43 } -
src/io/source_apple_audio.c
r5314432 rfc117d0 55 55 56 56 s->path = path; 57 s->samplerate = samplerate;58 57 s->block_size = block_size; 59 58 s->channels = 1; … … 61 60 OSStatus err = noErr; 62 61 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;76 62 77 63 // open the resource url … … 90 76 if (err) { AUBIO_ERROR("error in ExtAudioFileGetProperty, %d\n", (int)err); goto beach;} 91 77 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); 95 81 } 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; 96 96 97 97 // set the client format description -
src/io/source_apple_audio.h
r5314432 rfc117d0 28 28 void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s); 29 29 30 uint_t aubio_source_apple_audio_get_samplerate(aubio_source_apple_audio_t * s); 31 30 32 #endif /* _AUBIO_SOURCE_APPLE_AUDIO_H */ -
src/io/source_sndfile.c
r5314432 rfc117d0 70 70 71 71 s->hop_size = hop_size; 72 s->samplerate = samplerate;73 72 s->channels = 1; 74 73 s->path = path; … … 90 89 s->input_format = sfinfo.format; 91 90 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; 94 96 /* compute input block size required before resampling */ 95 97 s->ratio = s->samplerate/(float)s->input_samplerate; … … 192 194 } 193 195 196 uint_t aubio_source_sndfile_get_samplerate(aubio_source_sndfile_t * s) { 197 return s->samplerate; 198 } 199 194 200 #endif /* HAVE_SNDFILE */ -
src/io/source_sndfile.h
r5314432 rfc117d0 28 28 void del_aubio_source_sndfile(aubio_source_sndfile_t * s); 29 29 30 uint_t aubio_source_sndfile_get_samplerate(aubio_source_sndfile_t * s); 31 30 32 #endif /* _AUBIO_SOURCE_SNDFILE_H */
Note: See TracChangeset
for help on using the changeset viewer.