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

#include <NGIAgoraAudioTrack.h>

Inheritance diagram for agora::rtc::IRemoteAudioTrack:
agora::rtc::IAudioTrack agora::RefCountInterface

Public Member Functions

virtual bool getStatistics (RemoteAudioTrackStats &stats)=0
 
virtual REMOTE_AUDIO_STATE getState ()=0
 
virtual int registerMediaPacketReceiver (IMediaPacketReceiver *packetReceiver)=0
 
virtual int unregisterMediaPacketReceiver (IMediaPacketReceiver *packetReceiver)=0
 
virtual int setRemoteVoicePosition (float pan, float gain)=0
 
- Public Member Functions inherited from agora::rtc::IAudioTrack
virtual int adjustPlayoutVolume (int volume)=0
 
virtual int getPlayoutVolume (int *volume)=0
 
virtual bool addAudioFilter (agora_refptr< IAudioFilter > filter, AudioFilterPosition position)=0
 
virtual bool removeAudioFilter (agora_refptr< IAudioFilter > filter, AudioFilterPosition position)=0
 
virtual int enableAudioFilter (const char *id, bool enable)
 
virtual int setFilterProperty (const char *id, const char *key, const char *jsonValue)
 
virtual agora_refptr< IAudioFiltergetAudioFilter (const char *name, AudioFilterPosition position) const =0
 
virtual bool addAudioSink (agora_refptr< IAudioSinkBase > sink, const AudioSinkWants &wants)=0
 
virtual bool removeAudioSink (agora_refptr< IAudioSinkBase > sink)=0
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Additional Inherited Members

- Public Types inherited from agora::rtc::IAudioTrack
enum  AudioFilterPosition { RecordingLocalPlayback, PostAudioRecordingDevice, PostAudioProcessing }
 

Detailed Description

The IRemoteAudioTrack class.

Member Function Documentation

◆ getStatistics()

virtual bool agora::rtc::IRemoteAudioTrack::getStatistics ( RemoteAudioTrackStats stats)
pure virtual

Gets the statistics of the remote audio track.

Parameters
statsA reference to the statistics of the remote audio track: RemoteAudioTrackStats.
Returns
  • true: Success.
  • false: Failure.

◆ getState()

virtual REMOTE_AUDIO_STATE agora::rtc::IRemoteAudioTrack::getState ( )
pure virtual

Gets the state of the remote audio.

Returns
The state of the remote audio: #REMOTE_AUDIO_STATE.

◆ registerMediaPacketReceiver()

virtual int agora::rtc::IRemoteAudioTrack::registerMediaPacketReceiver ( IMediaPacketReceiver packetReceiver)
pure virtual

Registers an IMediaPacketReceiver object.

You need to implement the IMediaPacketReceiver class in this method. Once you successfully register the media packet receiver, the SDK triggers the onMediaPacketReceived callback when it receives an audio packet.

Parameters
packetReceiverThe pointer to the IMediaPacketReceiver object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ unregisterMediaPacketReceiver()

virtual int agora::rtc::IRemoteAudioTrack::unregisterMediaPacketReceiver ( IMediaPacketReceiver packetReceiver)
pure virtual

Releases the IMediaPacketReceiver object.

Parameters
packetReceiverThe pointer to the IMediaPacketReceiver object.
Returns
  • 0: Success.
  • < 0: Failure.

◆ setRemoteVoicePosition()

virtual int agora::rtc::IRemoteAudioTrack::setRemoteVoicePosition ( float  pan,
float  gain 
)
pure virtual

Sets the sound position and gain

Parameters
panThe sound position of the remote user. The value ranges from -1.0 to 1.0:
  • 0.0: the remote sound comes from the front.
  • -1.0: the remote sound comes from the left.
  • 1.0: the remote sound comes from the right.
gainGain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain.
Returns
  • 0: Success.
  • < 0: Failure.