Agora Java API Reference for Android
Public Member Functions | List of all members
agora::rtc::IAudioFilterBase Class Referenceabstract

#include <NGIAgoraMediaNode.h>

Inheritance diagram for agora::rtc::IAudioFilterBase:
agora::RefCountInterface agora::rtc::IAudioFilter

Public Member Functions

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

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
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 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.