30 #import <AudioToolbox/AudioToolbox.h>
31 #import <AudioUnit/AudioUnit.h>
32 #import <Foundation/Foundation.h>
37 #pragma mark - Notifications and constants
108 #pragma mark - Callbacks and protocols
130 const AudioTimeStamp *time,
132 AudioBufferList *audio);
189 @property (nonatomic, readonly)
float volume;
199 @property (nonatomic, readonly)
float pan;
229 static void *
const AEAudioSourceInput = ((
void*)0x01);
230 static void *
const AEAudioSourceMainOutput = ((
void*)0x02);
255 const AudioTimeStamp *time,
257 AudioBufferList *audio);
320 AudioBufferList *audio,
358 const AudioTimeStamp *time,
360 AudioBufferList *audio);
456 const AudioTimeStamp *time,
531 #pragma mark - Setup and start/stop
577 - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription;
587 - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription inputEnabled:(BOOL)enableInput;
598 - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription options:(
AEAudioControllerOptions)options;
610 - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription inputEnabled:(BOOL)enableInput useVoiceProcessing:(BOOL)useVoiceProcessing __deprecated_msg("use initWithAudioDescription:options: instead");
623 - (id)initWithAudioDescription:(AudioStreamBasicDescription)audioDescription inputEnabled:(BOOL)enableInput useVoiceProcessing:(BOOL)useVoiceProcessing outputEnabled:(BOOL)enableOutput __deprecated_msg("use initWithAudioDescription:options: instead");
631 - (BOOL)start:(NSError**)error;
648 - (BOOL)setAudioDescription:(AudioStreamBasicDescription)audioDescription error:(NSError**)error;
660 - (BOOL)setInputEnabled:(BOOL)inputEnabled error:(NSError**)error;
672 - (BOOL)setOutputEnabled:(BOOL)outputEnabled error:(NSError**)error;
685 - (BOOL)setAudioDescription:(AudioStreamBasicDescription)audioDescription
686 inputEnabled:(BOOL)inputEnabled
687 outputEnabled:(BOOL)outputEnabled
688 error:(NSError**)error;
692 #pragma mark - Channel and channel group management
703 - (void)addChannels:(NSArray*)channels;
711 - (void)addChannels:(NSArray*)channels toChannelGroup:(AEChannelGroupRef)group;
720 - (void)removeChannels:(NSArray*)channels;
728 - (void)removeChannels:(NSArray*)channels fromChannelGroup:(AEChannelGroupRef)group;
733 - (NSArray*)channels;
741 - (NSArray*)channelsInChannelGroup:(AEChannelGroupRef)group;
765 - (AEChannelGroupRef)createChannelGroupWithinChannelGroup:(AEChannelGroupRef)group;
774 - (void)removeChannelGroup:(AEChannelGroupRef)group;
789 - (NSArray*)channelGroupsInChannelGroup:(AEChannelGroupRef)group;
797 - (void)setVolume:(
float)volume forChannelGroup:(AEChannelGroupRef)group;
805 - (float)volumeForChannelGroup:(AEChannelGroupRef)group;
813 - (void)setPan:(
float)pan forChannelGroup:(AEChannelGroupRef)group;
821 - (float)panForChannelGroup:(AEChannelGroupRef)group;
832 - (void)setPlaying:(BOOL)playing forChannelGroup:(AEChannelGroupRef)group;
840 - (BOOL)channelGroupIsPlaying:(AEChannelGroupRef)group;
851 - (void)setMuted:(BOOL)muted forChannelGroup:(AEChannelGroupRef)group;
859 - (BOOL)channelGroupIsMuted:(AEChannelGroupRef)group;
862 #pragma mark - Filters
904 - (void)addFilter:(
id<
AEAudioFilter>)filter toChannelGroup:(AEChannelGroupRef)group;
923 - (void)addInputFilter:(
id<
AEAudioFilter>)filter forChannels:(NSArray*)channels;
946 - (void)removeFilter:(
id<
AEAudioFilter>)filter fromChannelGroup:(AEChannelGroupRef)group;
972 - (NSArray*)filtersForChannelGroup:(AEChannelGroupRef)group;
980 #pragma mark - Output receivers
1016 - (void)addOutputReceiver:(
id<
AEAudioReceiver>)receiver forChannelGroup:(AEChannelGroupRef)group;
1039 - (void)removeOutputReceiver:(
id<
AEAudioReceiver>)receiver fromChannelGroup:(AEChannelGroupRef)group;
1058 - (NSArray*)outputReceiversForChannelGroup:(AEChannelGroupRef)group;
1061 #pragma mark - Input receivers
1103 - (void)addInputReceiver:(
id<
AEAudioReceiver>)receiver forChannels:(NSArray*)channels;
1120 - (void)removeInputReceiver:(
id<
AEAudioReceiver>)receiver fromChannels:(NSArray*)channels;
1128 #pragma mark - Timing receivers
1159 #pragma mark - Realtime/Main thread messaging system
1192 - (void)performAsynchronousMessageExchangeWithBlock:(
void (^)())block
1193 responseBlock:(
void (^)())responseBlock;
1220 - (BOOL)performSynchronousMessageExchangeWithBlock:(
void (^)())block;
1263 int userInfoLength);
1279 #pragma mark - Metering
1289 - (void)outputAveragePowerLevel:(Float32*)averagePower peakHoldLevel:(Float32*)peakLevel;
1298 - (void)outputAveragePowerLevels:(Float32*)averagePowers peakHoldLevels:(Float32*)peakLevels channelCount:(UInt32)count;
1307 - (void)averagePowerLevel:(Float32*)averagePower peakHoldLevel:(Float32*)peakLevel forGroup:(AEChannelGroupRef)group;
1318 - (void)averagePowerLevels:(Float32*)averagePowers peakHoldLevels:(Float32*)peakLevels forGroup:(AEChannelGroupRef)group channelCount:(UInt32)count;
1326 - (void)inputAveragePowerLevel:(Float32*)averagePower peakHoldLevel:(Float32*)peakLevel;
1335 - (void)inputAveragePowerLevels:(Float32*)averagePowers peakHoldLevels:(Float32*)peakLevels channelCount:(UInt32)count;
1338 #pragma mark - Utilities
1368 #pragma mark - Properties
1377 #if TARGET_OS_IPHONE
1392 #if TARGET_OS_IPHONE
1404 #if TARGET_OS_IPHONE
1417 #if TARGET_OS_IPHONE
1431 #if TARGET_OS_IPHONE
1459 #if TARGET_OS_IPHONE
1560 #if TARGET_OS_IPHONE
1570 #if TARGET_OS_IPHONE
1586 #if TARGET_OS_IPHONE
1623 @property (nonatomic, readonly) BOOL inputEnabled;
1630 @property (nonatomic, readonly) BOOL outputEnabled;
1656 @property (nonatomic, readonly) AudioStreamBasicDescription audioDescription;
1668 #pragma mark - Timing
1687 #if TARGET_OS_IPHONE
1708 #if TARGET_OS_IPHONE