*/
-#include "config.h"
-#ifdef TARGET_OS_IPHONE
#include "aubio_priv.h"
+#ifdef HAVE_AUDIO_UNIT
#include "fvec.h"
#include "fmat.h"
o->au_ios_inbuf = AUBIO_ARRAY(SInt16, AU_IOS_MAX_FRAMES * o->hw_input_channels);
/* the floats coming from and to the device callback */
- o->output_frames = new_fmat(blocksize, sw_output_channels);
- o->input_frames = new_fmat(blocksize, sw_input_channels);
+ o->output_frames = new_fmat(sw_output_channels, blocksize);
+ o->input_frames = new_fmat(sw_input_channels, blocksize);
/* check for some sizes */
if ( o->hw_output_channels != o->output_frames->height ) {
audioFormat.mSampleRate = (Float64)samplerate;
audioFormat.mChannelsPerFrame = 2;
audioFormat.mFormatID = kAudioFormatLinearPCM;
- audioFormat.mFormatFlags = kAudioFormatFlagsCanonical;
+ audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
- audioFormat.mBitsPerChannel = 8 * sizeof(AudioSampleType);
+ audioFormat.mBitsPerChannel = 8 * sizeof(SInt16);
#if 1 // interleaving
- audioFormat.mBytesPerFrame = 2 * sizeof(AudioSampleType);
- audioFormat.mBytesPerPacket = 2 * sizeof(AudioSampleType);
+ audioFormat.mBytesPerFrame = 2 * sizeof(SInt16);
+ audioFormat.mBytesPerPacket = 2 * sizeof(SInt16);
#else
- audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame = sizeof(AudioUnitSampleType);
+ audioFormat.mBytesPerPacket = audioFormat.mBytesPerFrame = sizeof(SInt32);
audioFormat.mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
#endif
if (o->verbose) {
AUBIO_MSG ("audio_unit: current route is %s\n", route);
}
- free(route);
+ //free(route);
}
if( currentRoute ) {
if( CFStringCompare( currentRoute, CFSTR("Headset"), 0 ) == kCFCompareEqualTo ) {
return (int)err;
}
-#endif /* TARGET_OS_IPHONE */
+#endif /* HAVE_AUDIO_UNIT */