Filter port. More...
#import <ABAudioFilterPort.h>
Inherits ABPort, and <ABLocalPort>.
Instance Methods | |
(id) | - initWithName:title:audioComponentDescription:processBlock:processBlockSize: |
Initialize. | |
(id) | - initWithName:title:audioComponentDescription:audioUnit: |
Initialize. | |
(void) | - registerAdditionalAudioComponentDescription: |
Register additional AudioComponentDescriptions that identify your audio unit. | |
(BOOL) | - ABAudioFilterPortIsConnected |
Determine if the filter port is currently connected. | |
![]() | |
(void) | - launch |
Launches the app belonging to the port and triggers ABPortWillLaunchPortNotification in the appropriate app. | |
(NSArray *audioPipelineIDs) | - __deprecated_msg |
(NSArray *MIDIPipelineIDs) | - __deprecated_msg |
Properties | |
AudioUnit | audioUnit |
Audio unit. | |
AudioStreamBasicDescription | clientFormat |
Client format. | |
NSArray * | sources |
Currently-connected sources. | |
NSArray * | destinations |
Currently-connected destinations. | |
BOOL | connected |
Whether the port is connected (via IAA or Audiobus) | |
BOOL | interAppAudioConnected |
Whether the port is connected via Inter-App Audio. | |
BOOL | audiobusConnected |
Whether the port is connected via Audiobus. | |
AudioComponentDescription | audioComponentDescription |
The AudioComponentDescription, of type kAudioUnitType_RemoteEffect or kAudioUnitType_RemoteMusicEffect, which identifies this port's published audio unit. | |
NSString * | title |
The title of the port, for display to the user. | |
UIImage * | icon |
The port icon (a 32x32 image) | |
UInt32 | latency |
The constant latency of this filter, in frames. | |
BOOL | bypassed |
Whether the port is bypassed. | |
NSString * | sourcesTitle |
A title representing the sources connected to the port. | |
UIImage * | sourcesIcon |
An icon representing the sources connected to the port. | |
NSString * | destinationsTitle |
A title representing the destinations the port is connected to. | |
UIImage * | destinationsIcon |
An icon representing the destinations the port is connected to. | |
![]() | |
ABPeer * | peer |
The peer this port is on. | |
NSString * | name |
The internal port name. | |
NSString * | title |
The title of the port, for display to the user. | |
UIImage * | icon |
The port icon (a 64x64 image) | |
ABPortType | type |
The type of the port. | |
uint8_t | attributes |
The attributes of this port. | |
id | context |
Use this property to associate some user defined context with the port. | |
uint32_t | uniqueIdentifier |
An port identifier that is unique for the peer itself but also for other peers. | |
BOOL | connected |
Whether the port is connected. | |
NSString * | sourcesTitle |
A title representing the sources connected to the port. | |
UIImage * | sourcesIcon |
An icon representing the sources connected to the port. | |
NSArray * | sourcesRecursive |
Returns direct and indirect sources of the port in the pipeline. | |
NSString * | destinationsTitle |
A title representing the destinations the port is connected to. | |
UIImage * | destinationsIcon |
An icon representing the destinations the port is connected to. | |
NSArray * | destinationsRecursive |
Returns direct and indirect destinations of the port in the pipeline. | |
NSSet < ABConnectionGraphPipeline * > * | pipelines |
The connection pipelines of which this port is a member. | |
Filter port.
This class is used to filter audio.
See the integration guide's section on using the Filter Port for discussion.
- (id) initWithName: | (NSString *) | name | |
title: | (NSString *) | title | |
audioComponentDescription: | (AudioComponentDescription) | description | |
processBlock: | (ABAudioFilterBlock) | processBlock | |
processBlockSize: | (UInt32) | processBlockSize | |
Initialize.
Initializes a new filter port, with a block to use for filtering
name | The name of the filter port, for internal use |
title | Title of port, show to the user |
description | The AudioComponentDescription that identifiers this port. This must match the entry in the AudioComponents dictionary of your Info.plist, and must be of type kAudioUnitType_RemoteEffect or kAudioUnitType_RemoteMusicEffect. |
processBlock | A block to use to process audio as it arrives at the filter port |
processBlockSize | Specify the number of frames you want to process each time the filter block is called. Audiobus will automatically queue up frames until this number is reached, then call the audio block for this number of frames. Set to 0 if this value is unimportant, and Audiobus will use whatever number of frames results in the least latency. |
- (id) initWithName: | (NSString *) | name | |
title: | (NSString *) | title | |
audioComponentDescription: | (AudioComponentDescription) | description | |
audioUnit: | (AudioUnit) | audioUnit | |
Initialize.
Initializes a new filter port, with an audio unit for filtering
Note: The audio unit you pass here must be an output unit (kAudioUnitSubType_RemoteIO). If you wish to use a different kind of audio unit, you'll need to use the process block initialiser and call AudioUnitRender on the audio unit yourself from within the process block, while feeding its input via a callback that passes in the audio given to you in the process block.
name | The name of the filter port, for internal use |
title | Title of port, show to the user |
description | The AudioComponentDescription that identifiers this port. This must match the entry in the AudioComponents dictionary of your Info.plist, and must be of type kAudioUnitType_RemoteEffect or kAudioUnitType_RemoteMusicEffect. |
audioUnit | The output audio unit to use for processing. The audio unit's input will be replaced with the audio to process. |
- (void) registerAdditionalAudioComponentDescription: | (AudioComponentDescription) | description |
Register additional AudioComponentDescriptions that identify your audio unit.
Sometimes under Inter-App Audio you may wish to publish your audio unit with an additional AudioComponentDescription, such as providing both kAudioUnitType_RemoteEffect and kAudioUnitType_RemoteMusicEffect types.
If you wish to do so, you can use this method to register the additional descriptions (additional to the one passed via the init method). Note that this method will not publish your audio unit with the given description: you'll need to do that yourself.
This will cause the port to correctly recognize incoming connections from the other descriptions.
description | The additional AudioComponentDescription to add |
- (BOOL) ABAudioFilterPortIsConnected | (ABAudioFilterPort *) | filterPort |
Determine if the filter port is currently connected.
If you are using the processBlock initializer, then you must mute your app's main audio output when this function returns YES.
This function is suitable for use from within a realtime Core Audio context.
filterPort | The filter port. |
|
readwritenonatomicassign |
Audio unit.
The audio unit to use for processing. If you uninitialize the audio unit passed to this class's initializer, be sure to set this property to NULL immediately beforehand.
If you did not provide an audio unit when initializing the port, this property will allow you to gain access to the internal audio unit used for audio transport, for the purposes of custom Inter-App Audio interactions such as transport control or MIDI exchange.
|
readwritenonatomicassign |
Client format.
If you're using a process block for processing, use this to specify what audio format to use. Audio will be automatically converted to and from the Audiobus line format.
The default value is non-interleaved stereo floating-point PCM.
|
readnonatomicstrong |
Currently-connected sources.
This is an array of ABPorts .
|
readnonatomicstrong |
Currently-connected destinations.
This is an array of ABPorts .
|
readnonatomicassign |
Whether the port is connected (via IAA or Audiobus)
|
readnonatomicassign |
Whether the port is connected via Inter-App Audio.
Note that this property will also return YES when connected to Audiobus peers using the 2.1 SDK.
|
readnonatomicassign |
Whether the port is connected via Audiobus.
|
readnonatomicassign |
The AudioComponentDescription, of type kAudioUnitType_RemoteEffect or kAudioUnitType_RemoteMusicEffect, which identifies this port's published audio unit.
|
readwritenonatomicstrong |
The title of the port, for display to the user.
|
readwritenonatomicstrong |
The port icon (a 32x32 image)
This is optional if your app only has one filter port, but if your app defines multiple filter ports, it is highly recommended that you provide icons for each, for easy identification by the user.
|
readwritenonatomicassign |
The constant latency of this filter, in frames.
If your filter code adds a constant amount of latency to the audio stream (such as an FFT or lookahead operation), you should specify that here in order to have Audiobus automatically account for it.
This is important when users have the same input signal going through different paths, so that Audiobus can synchronize these properly at the output. If you don't specify the correct latency, the user will hear phasing due to incorrectly aligned signals at the output.
Default: 0
|
readwritenonatomicassign |
Whether the port is bypassed.
This property value is automatically managed by an in-built trigger that appears to users from within the Connection Panel. If your filter app also provides its own bypass controls, you can use this property to keep the state of the built-in bypass feature and your app's own bypass feature synchronized.
|
readnonatomicassign |
A title representing the sources connected to the port.
|
readnonatomicassign |
An icon representing the sources connected to the port.
|
readnonatomicassign |
A title representing the destinations the port is connected to.
|
readnonatomicassign |
An icon representing the destinations the port is connected to.