Agora RTC Objective-C API Reference  Refactor
Data Structures | Public Member Functions
IAudioFilterV2 Class Referenceabstract

Inherits IAudioFilter.

Data Structures

class  Control
 

Public Member Functions

virtual void setExtensionControl (agora::agora_refptr< IAudioFilterV2::Control > control)=0
 
virtual void setEnabled (bool enable)=0
 
virtual bool isEnabled () const =0
 
virtual int setProperty (const char *key, const void *buf, int buf_size)=0
 
virtual int getProperty (const char *key, void *buf, int buf_size) const =0
 
virtual const char * getName () const =0
 
virtual int getPreferredSampleRate ()
 
virtual int getPreferredChannelNumbers ()
 
virtual bool adaptAudioFrame (const media::base::AudioPcmFrame &inAudioFrame, media::base::AudioPcmFrame &adaptedFrame)=0
 

Member Function Documentation

◆ setExtensionControl()

virtual void setExtensionControl ( agora::agora_refptr< IAudioFilterV2::Control control)
pure virtual

AgoraSDK set IAudioFilterV2::Control to filter.

Parameters
controlIAudioFilterV2::Control

◆ setEnabled()

virtual void setEnabled ( bool  enable)
pure virtualinherited

Enables or disables the audio filter.

Parameters
enableWhether to enable the audio filter:
  • true: Enable the audio filter.
  • false: Do not enable the audio filter.

◆ isEnabled()

virtual bool isEnabled ( ) const
pure virtualinherited

Checks whether the audio filter is enabled.

Returns
  • true: The audio filter is enabled.
  • false: The audio filter is not enabled.

◆ setProperty()

virtual int setProperty ( const char *  key,
const void *  buf,
int  buf_size 
)
pure virtualinherited

Sets a private property in the IAudioFilter class.

Parameters
keyThe pointer to the property name.
bufThe pointer to the buffer of this private property.
buf_sizeThe buffer size of this private property.
Returns
  • The actual size of the private property, if the method call succeeds.
  • -1, if the method call fails.

◆ getProperty()

virtual int getProperty ( const char *  key,
void *  buf,
int  buf_size 
) const
pure virtualinherited

Gets a private property in the IAudioFilter class.

Parameters
nameThe pointer to the property name.
bufThe pointer to the buffer of this private property.
buf_sizeThe buffer size of this private property.
Returns
  • The actual size of the private property, if the method call succeeds.
  • -1, if the method call fails.

◆ getName()

virtual const char* getName ( ) const
pure virtualinherited

Gets the name of the IAudioFilter class.

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

◆ getPreferredSampleRate()

virtual int getPreferredSampleRate ( )
inlinevirtualinherited

Get the sample rate supported by the audio filter, the framework will resample the audio data and then pass it to the audio filter. If the user does not overwrite, resampling will not be done by default.

Returns
  • 0: Audio data will not be resampled.
  • > 0: Audio data will be resampled to this sample rate.

Implements IAudioFilterBase.

◆ getPreferredChannelNumbers()

virtual int getPreferredChannelNumbers ( )
inlinevirtualinherited

Get the channel number supported by the audio filter, the framework will resample the audio data and then pass it to the audio filter. If the user does not overwrite, resampling will not be done by default.

Returns
  • 0: Audio data will not be resampled.
  • > 0: Audio data will be resampled to this sample rate.

Implements IAudioFilterBase.

◆ adaptAudioFrame()

virtual bool adaptAudioFrame ( const media::base::AudioPcmFrame inAudioFrame,
media::base::AudioPcmFrame adaptedFrame 
)
pure virtualinherited

Adapts the audio frame.

Parameters
inAudioFrameThe reference to the audio frame that you want to adapt.
adaptedFrameThe reference to the adapted audio frame.
Returns
  • true: Success.
  • false: Failure. For example, the IAudiofilter object drops the audio frame.

◆ AddRef()

virtual void AddRef ( ) const
pure virtualinherited

◆ Release()

virtual RefCountReleaseStatus Release ( ) const
pure virtualinherited

◆ HasOneRef()

virtual bool HasOneRef ( ) const
pure virtualinherited