Agora RTC Objective-C API Reference  Refactor
Public Member Functions
IAudioFilterBase Class Referenceabstract

Inherits RefCountInterface.

Inherited by IAudioFilter.

Public Member Functions

virtual bool adaptAudioFrame (const media::base::AudioPcmFrame &inAudioFrame, media::base::AudioPcmFrame &adaptedFrame)=0
 
virtual int getPreferredSampleRate ()=0
 
virtual int getPreferredChannelNumbers ()=0
 

Detailed Description

The IAudioFilterBase class is the base class for audio filters. You can use this class to implement your own filter and add it to an audio track.

Constructor & Destructor Documentation

◆ ~IAudioFilterBase()

~IAudioFilterBase ( )
inlineprotected

Member Function Documentation

◆ adaptAudioFrame()

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

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.

◆ getPreferredSampleRate()

virtual int getPreferredSampleRate ( )
pure virtual

Get the sample rate supported by the audio filter, the framework will resample the audio data and then pass it to the audio filter.

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

Implemented in IAudioFilter.

◆ getPreferredChannelNumbers()

virtual int getPreferredChannelNumbers ( )
pure virtual

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.

Implemented in IAudioFilter.

◆ AddRef()

virtual void AddRef ( ) const
pure virtualinherited

◆ Release()

virtual RefCountReleaseStatus Release ( ) const
pure virtualinherited

◆ HasOneRef()

virtual bool HasOneRef ( ) const
pure virtualinherited