diff options
author | Alfred E. Heggestad <aeh@db.org> | 2016-03-06 21:40:17 +0100 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2016-03-06 21:40:17 +0100 |
commit | 3ea726dba7b72761344a97da7591485a5c89d871 (patch) | |
tree | 85ca0995d0dd0ec4ec8d44281b62e42325ec5b45 | |
parent | 7e002c7d0aad76fb78b57679d597fc270cd6e573 (diff) |
audiounit: add compile-time check for IOS or MAC (ref issue #91)
-rw-r--r-- | modules/audiounit/recorder.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/audiounit/recorder.c b/modules/audiounit/recorder.c index 663fc3d..50d7d0f 100644 --- a/modules/audiounit/recorder.c +++ b/modules/audiounit/recorder.c @@ -5,6 +5,7 @@ */ #include <AudioUnit/AudioUnit.h> #include <AudioToolbox/AudioToolbox.h> +#include <TargetConditionals.h> #include <pthread.h> #include <re.h> #include <baresip.h> @@ -106,6 +107,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, AURenderCallbackStruct cb; struct ausrc_st *st; UInt32 enable = 1; +#if ! TARGET_OS_IPHONE UInt32 ausize; ausize = sizeof(AudioDeviceID); AudioDeviceID inputDevice; @@ -113,6 +115,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, kAudioHardwarePropertyDefaultInputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; +#endif Float64 hw_srate = 0.0; UInt32 hw_size = sizeof(hw_srate); OSStatus ret = 0; @@ -149,6 +152,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, if (ret) goto out; +#if ! TARGET_OS_IPHONE enable = 0; ret = AudioUnitSetProperty(st->au, kAudioOutputUnitProperty_EnableIO, kAudioUnitScope_Output, 0, @@ -173,6 +177,7 @@ int audiounit_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as, sizeof(inputDevice)); if (ret) goto out; +#endif fmt.mSampleRate = prm->srate; fmt.mFormatID = kAudioFormatLinearPCM; |