|
8 | 8 | #import <AudioToolbox/AudioToolbox.h>
|
9 | 9 | #import <Z/types/base.h>
|
10 | 10 | #import "system.h"
|
| 11 | +#import <Z/inspection/OS.h> |
11 | 12 |
|
12 |
| -using namespace ZKit; |
| 13 | +using namespace Zeta; |
13 | 14 |
|
14 | 15 |
|
15 | 16 | static OSStatus FillBuffer(
|
@@ -44,8 +45,14 @@ CoreAudioOutputPlayer::CoreAudioOutputPlayer()
|
44 | 45 | // Configure the search parameters to find the default playback output unit. |
|
45 | 46 | //---------------------------------------------------------------------------'
|
46 | 47 | AudioComponentDescription output_description = {
|
47 |
| - .componentType = kAudioUnitType_Output, |
48 |
| - .componentSubType = kAudioUnitSubType_DefaultOutput, |
| 48 | + .componentType = kAudioUnitType_Output, |
| 49 | + |
| 50 | +# if Z_OS == Z_OS_MAC_OS_X |
| 51 | + .componentSubType = kAudioUnitSubType_DefaultOutput, |
| 52 | +# elif Z_OS == Z_OS_IOS |
| 53 | + .componentSubType = kAudioUnitSubType_GenericOutput, |
| 54 | +# endif |
| 55 | + |
49 | 56 | .componentManufacturer = kAudioUnitManufacturer_Apple,
|
50 | 57 | .componentFlags = 0,
|
51 | 58 | .componentFlagsMask = 0
|
@@ -84,10 +91,11 @@ CoreAudioOutputPlayer::CoreAudioOutputPlayer()
|
84 | 91 | //NSAssert1(error == noErr, @"Error setting maximum frames per slice: %hd", error);
|
85 | 92 |
|
86 | 93 | // Set the buffer size
|
87 |
| - |
88 |
| - error = AudioUnitSetProperty |
89 |
| - (_audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, |
90 |
| - 0, &frames, sizeof(frames)); |
| 94 | +# if Z_OS == Z_OS_MAC_OS_X |
| 95 | + error = AudioUnitSetProperty |
| 96 | + (_audio_unit, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Global, |
| 97 | + 0, &frames, sizeof(frames)); |
| 98 | +# endif |
91 | 99 |
|
92 | 100 | //NSAssert1(error == noErr, @"Error setting buffer frame size: %hd", error);
|
93 | 101 |
|
|
0 commit comments