Agora RTC Objective-C API Reference Refactor

Instance Methods
<AgoraAudioFilterDelegate> Protocol Reference

Inherits <NSObject>.

## Instance Methods
(BOOL) | - adaptAudioFrame:dstFrame:
(void) | - setEnabled:
(BOOL) | - isEnabled
(NSInteger) | - setPropertyWithKey:value:
(NSInteger) | - getPropertyWithKey:value:
(NSString *__nonnull) | - getName

## Detailed Description

The `AgoraAudioFilterDelegate` protocol.

This protocol is the intermediate node for audio, which reads audio frames from the underlying pipeline and writes audio frames back after adaptation.

## Method Documentation

## ◆ adaptAudioFrame:dstFrame:

- (BOOL) adaptAudioFrame: |  | (AgoraAudioPcmFrame *__nonnull) | srcFrame
dstFrame: |  | (AgoraAudioPcmFrame *_Nullable *_Nullable) | dstFrame

Adapts the audio frame.

Parameters

  srcFrame | The pointer to the audio frame that you want to adapt.
  dstFrame | The in/out pointer to the adapted audio frame.

Returns
  - `YES`: Success.
  - `NO`: Failure. For example, the IAudiofilter object drops the audio frame.

## ◆ setEnabled:

- (void) setEnabled: |  | (BOOL) | enabled |

Enables or disables the audio filter.

Parameters

  enable | Whether to enable the audio filter: `YES`: Enable the audio filter. `NO`: Do not enable the audio filter.

## ◆ isEnabled

- (BOOL) isEnabled |  |  |

Checks whether the audio filter is enabled.

Returns
  - `YES`: The audio filter is enabled.
  - `NO`: The audio filter is not enabled.

## ◆ setPropertyWithKey:value:

- (NSInteger) setPropertyWithKey: |  | (NSString *__nonnull) | key
value: |  | (NSData *__nonnull) | value

Sets a private property in the `IAudioFilter` class.

Parameters

  key | The pointer to the property name.
  value | The pointer to the buffer of this private property.

Returns
  - The actual size of the private property, if the method call succeeds.
  - -1, if the method call fails.

## ◆ getPropertyWithKey:value:

- (NSInteger) getPropertyWithKey: |  | (NSString *__nonnull) | key
value: |  | (NSData *_Nullable *_Nullable) | value

Gets a private property in the `IAudioFilter` class.

Parameters

  key | The pointer to the property name.
  (in/out) | value The pointer to the buffer of this private property.

Returns
  - The actual size of the private property, if the method call succeeds.
  - -1, if the method call fails.

## ◆ getName

- (NSString * __nonnull) getName |  |  |

Gets the name of the `AgoraAudioFilterDelegate` class.

Returns
  - The name of the audio filter, if the method call succeeds.
  - An empty string, if the method call fails.