Agora C++ API Reference for All Platforms

Public Member Functions | Protected Member Functions | List of all members
agora::rtc::IAudioFilterBase Class Referenceabstract

Inherits agora::RefCountInterface.

Inherited by agora::rtc::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
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
| ~IAudioFilterBase ()
Protected Member Functions inherited from agora::RefCountInterface
virtual | ~RefCountInterface ()

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

agora::rtc::IAudioFilterBase::~IAudioFilterBase | ( |  | ) |
| inline protected

## Member Function Documentation

## ◆ adaptAudioFrame()

virtual bool agora::rtc::IAudioFilterBase::adaptAudioFrame | ( | const media::base::AudioPcmFrame & | inAudioFrame,
|  | media::base::AudioPcmFrame & | adaptedFrame
| ) |  |
| pure virtual

Adapts the audio frame.

Parameters

  inAudioFrame | The reference to the audio frame that you want to adapt.
  adaptedFrame | The reference to the adapted audio frame.

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

## ◆ getPreferredSampleRate()

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

## ◆ getPreferredChannelNumbers()

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