-#include "config.h"
+#include "aubio_priv.h"
#if defined(HAVE_SOURCE_APPLE_AUDIO) || defined(HAVE_SINK_APPLE_AUDIO)
#include <CoreFoundation/CoreFoundation.h>
// ExtAudioFileRef, AudioStreamBasicDescription, AudioBufferList, ...
#include <AudioToolbox/AudioToolbox.h>
-#include "aubio_priv.h"
int createAubioBufferList(AudioBufferList *bufferList, int channels, int segmentSize);
void freeAudioBufferList(AudioBufferList *bufferList);
CFURLRef getURLFromPath(const char * path);
char_t *getPrintableOSStatusError(char_t *str, OSStatus error);
-int createAubioBufferList(AudioBufferList * bufferList, int channels, int max_source_samples) {
+int createAudioBufferList(AudioBufferList * bufferList, int channels,
+ int max_source_samples) {
bufferList->mNumberBuffers = 1;
bufferList->mBuffers[0].mNumberChannels = channels;
- bufferList->mBuffers[0].mData = AUBIO_ARRAY(short, max_source_samples);
- bufferList->mBuffers[0].mDataByteSize = max_source_samples * sizeof(short);
+ bufferList->mBuffers[0].mData = AUBIO_ARRAY(smpl_t, max_source_samples);
+ bufferList->mBuffers[0].mDataByteSize = max_source_samples * sizeof(smpl_t);
return 0;
}
bufferList = NULL;
}
-CFURLRef getURLFromPath(const char * path) {
+CFURLRef createURLFromPath(const char * path) {
CFStringRef cfTotalPath = CFStringCreateWithCString (kCFAllocatorDefault,
path, kCFStringEncodingUTF8);
- return CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfTotalPath,
+ CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfTotalPath,
kCFURLPOSIXPathStyle, false);
+ CFRelease(cfTotalPath);
+ return url;
}
char_t *getPrintableOSStatusError(char_t *str, OSStatus error)