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

Inherits agora::rtc::IAVDataObserver, agora::media::IAudioFrameObserver, and agora::media::IVideoEncodedFrameObserver.

Public Member Functions

virtual int startRecording (const media::MediaRecorderConfiguration &config)=0
 
virtual int stopRecording ()=0
 
virtual void release ()=0
 
virtual void setMediaRecorderObserver (media::IMediaRecorderObserverEx *observer)=0
 
virtual void setSysVersion (int sys_version)=0
 
bool onPlaybackAudioFrame (const char *channelId, AudioFrame &audioFrame) override
 
bool onMixedAudioFrame (const char *channelId, AudioFrame &audioFrame) override
 
bool onEarMonitoringAudioFrame (AudioFrame &audioFrame) override
 
AudioParams getPlaybackAudioParams () override
 
AudioParams getRecordAudioParams () override
 
AudioParams getMixedAudioParams () override
 
AudioParams getEarMonitoringAudioParams () override
 
- Public Member Functions inherited from agora::rtc::IAVDataObserver
virtual ~IAVDataObserver ()
 
virtual bool onAVDataReady (const AVData &avdata)=0
 
- Public Member Functions inherited from agora::media::IAudioFrameObserver
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, rtc::uid_t uid, AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
 
- Public Member Functions inherited from agora::media::IAudioFrameObserverBase
virtual ~IAudioFrameObserverBase ()
 
virtual bool onRecordAudioFrame (const char *channelId, AudioFrame &audioFrame)=0
 
virtual bool onPlaybackAudioFrameBeforeMixing (const char *channelId, base::user_id_t userId, AudioFrame &audioFrame)
 
virtual int getObservedAudioFramePosition ()=0
 
- Public Member Functions inherited from agora::media::IVideoEncodedFrameObserver
virtual bool onEncodedVideoFrameReceived (rtc::uid_t uid, const uint8_t *imageBuffer, size_t length, const rtc::EncodedVideoFrameInfo &videoEncodedFrameInfo)=0
 
virtual ~IVideoEncodedFrameObserver ()
 

Additional Inherited Members

- Public Types inherited from agora::rtc::IAVDataObserver
enum  AVDATA_TYPE { AVDATA_UNKNOWN = 0, AVDATA_VIDEO = 1, AVDATA_AUDIO = 2, AVDATA_AUDIO_MUTE = 3 }
 
enum  CODEC_VIDEO { CODEC_VIDEO_AVC = 0, CODEC_VIDEO_HEVC = 1, CODEC_VIDEO_VP8 = 2 }
 
enum  CODEC_AUDIO { CODEC_AUDIO_PCM = 0, CODEC_AUDIO_AAC = 1, CODEC_AUDIO_G722 = 2 }
 
- Public Types inherited from agora::media::IAudioFrameObserverBase
enum  AUDIO_FRAME_TYPE { FRAME_TYPE_PCM16 = 0 }
 
enum  { MAX_HANDLE_TIME_CNT = 10 }
 
enum  AUDIO_FRAME_POSITION {
  AUDIO_FRAME_POSITION_NONE = 0x0000, AUDIO_FRAME_POSITION_PLAYBACK = 0x0001, AUDIO_FRAME_POSITION_RECORD = 0x0002, AUDIO_FRAME_POSITION_MIXED = 0x0004,
  AUDIO_FRAME_POSITION_BEFORE_MIXING = 0x0008, AUDIO_FRAME_POSITION_EAR_MONITORING = 0x0010
}
 

Member Function Documentation

◆ startRecording()

virtual int agora::rtc::IMediaRecorderEx::startRecording ( const media::MediaRecorderConfiguration config)
pure virtual

◆ stopRecording()

virtual int agora::rtc::IMediaRecorderEx::stopRecording ( )
pure virtual

◆ release()

virtual void agora::rtc::IMediaRecorderEx::release ( )
pure virtual

◆ setMediaRecorderObserver()

virtual void agora::rtc::IMediaRecorderEx::setMediaRecorderObserver ( media::IMediaRecorderObserverEx observer)
pure virtual

◆ setSysVersion()

virtual void agora::rtc::IMediaRecorderEx::setSysVersion ( int  sys_version)
pure virtual

◆ onPlaybackAudioFrame()

bool agora::rtc::IMediaRecorderEx::onPlaybackAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the playback audio frame is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The playback audio frame is valid and is encoded and sent.
  • false: The playback audio frame is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ onMixedAudioFrame()

bool agora::rtc::IMediaRecorderEx::onMixedAudioFrame ( const char *  channelId,
AudioFrame audioFrame 
)
inlineoverridevirtual

Occurs when the mixed audio data is received.

Parameters
channelIdThe channel name
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The mixed audio data is valid and is encoded and sent.
  • false: The mixed audio data is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ onEarMonitoringAudioFrame()

bool agora::rtc::IMediaRecorderEx::onEarMonitoringAudioFrame ( AudioFrame audioFrame)
inlineoverridevirtual

Occurs when the ear monitoring audio frame is received.

Parameters
audioFrameThe reference to the audio frame: AudioFrame.
Returns
  • true: The ear monitoring audio data is valid and is encoded and sent.
  • false: The ear monitoring audio data is invalid and is not encoded or sent.

Implements agora::media::IAudioFrameObserverBase.

◆ getPlaybackAudioParams()

AudioParams agora::rtc::IMediaRecorderEx::getPlaybackAudioParams ( )
inlineoverridevirtual

Sets the audio playback format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onPlaybackAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getRecordAudioParams()

AudioParams agora::rtc::IMediaRecorderEx::getRecordAudioParams ( )
inlineoverridevirtual

Sets the audio recording format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onRecordAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getMixedAudioParams()

AudioParams agora::rtc::IMediaRecorderEx::getMixedAudioParams ( )
inlineoverridevirtual

Sets the audio mixing format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onMixedAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.

◆ getEarMonitoringAudioParams()

AudioParams agora::rtc::IMediaRecorderEx::getEarMonitoringAudioParams ( )
inlineoverridevirtual

Sets the ear monitoring audio format Note**:

  • The SDK calculates the sample interval according to the AudioParams you set in the return value of this callback and triggers the onEarMonitoringAudioFrame callback at the calculated sample interval. Sample interval (seconds) = samplesPerCall/(sampleRate × channel). Ensure that the value of sample interval is equal to or greater than 0.01.
Returns
Sets the audio format. See AgoraAudioParams.

Implements agora::media::IAudioFrameObserverBase.