Agora C++ API Reference for All Platforms
Public Member Functions | Protected Member Functions | List of all members
agora::rtc::IAudioFilter Class Referenceabstract

Inherits agora::rtc::IAudioFilterBase.

Public Member Functions

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
 
int getPreferredSampleRate () override
 
- Public Member Functions inherited from agora::rtc::IAudioFilterBase
virtual bool adaptAudioFrame (const media::base::AudioPcmFrame &inAudioFrame, media::base::AudioPcmFrame &adaptedFrame)=0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Protected Member Functions

 ~IAudioFilter ()
 
- Protected Member Functions inherited from agora::rtc::IAudioFilterBase
 ~IAudioFilterBase ()
 
- Protected Member Functions inherited from agora::RefCountInterface
virtual ~RefCountInterface ()
 

Detailed Description

The IAudioFilter class.

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

Constructor & Destructor Documentation

◆ ~IAudioFilter()

agora::rtc::IAudioFilter::~IAudioFilter ( )
inlineprotected

Member Function Documentation

◆ setEnabled()

virtual void agora::rtc::IAudioFilter::setEnabled ( bool  enable)
pure virtual

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 agora::rtc::IAudioFilter::isEnabled ( ) const
pure virtual

Checks whether the audio filter is enabled.

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

◆ setProperty()

virtual int agora::rtc::IAudioFilter::setProperty ( const char *  key,
const void *  buf,
int  buf_size 
)
pure virtual

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 agora::rtc::IAudioFilter::getProperty ( const char *  key,
void *  buf,
int  buf_size 
) const
pure virtual

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* agora::rtc::IAudioFilter::getName ( ) const
pure virtual

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()

int agora::rtc::IAudioFilter::getPreferredSampleRate ( )
inlineoverridevirtual

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 agora::rtc::IAudioFilterBase.