Video SDK v3.7.1 API Reference for Unity
Public Member Functions | List of all members
agora_gaming_rtc.AudioRawDataManager Class Reference

Inherits agora_gaming_rtc.IAudioRawDataManager.

Public Member Functions

delegate void OnRecordAudioFrameHandler (AudioFrame audioFrame)
 
delegate void OnPlaybackAudioFrameHandler (AudioFrame audioFrame)
 
delegate void OnMixedAudioFrameHandler (AudioFrame audioFrame)
 
delegate void OnPlaybackAudioFrameBeforeMixingHandler (uint uid, AudioFrame audioFrame)
 
override int SetOnRecordAudioFrameCallback (OnRecordAudioFrameHandler action)
 
override int SetOnPlaybackAudioFrameCallback (OnPlaybackAudioFrameHandler action)
 
override int SetOnMixedAudioFrameCallback (OnMixedAudioFrameHandler action)
 
override int SetOnPlaybackAudioFrameBeforeMixingCallback (OnPlaybackAudioFrameBeforeMixingHandler action)
 
override int RegisterAudioRawDataObserver ()
 
override int UnRegisterAudioRawDataObserver ()
 
override int PullAudioFrame (IntPtr audioBuffer, int type, int samples, int bytesPerSample, int channels, int samplesPerSec, long renderTimeMs, int avsync_type)
 

Detailed Description

The definition of AudioRawDataManager.

Member Function Documentation

◆ OnRecordAudioFrameHandler()

delegate void agora_gaming_rtc.AudioRawDataManager.OnRecordAudioFrameHandler ( AudioFrame  audioFrame)

Retrieves the recorded audio frame.

The SDK triggers this callback once every 10 ms.

Parameters
audioFrameSee AudioFrame.

◆ OnPlaybackAudioFrameHandler()

delegate void agora_gaming_rtc.AudioRawDataManager.OnPlaybackAudioFrameHandler ( AudioFrame  audioFrame)

Retrieves the audio playback frame.

The SDK triggers this callback once every 10 ms.

Parameters
audioFrameSee AudioFrame.

◆ OnMixedAudioFrameHandler()

delegate void agora_gaming_rtc.AudioRawDataManager.OnMixedAudioFrameHandler ( AudioFrame  audioFrame)

Retrieves the mixed recorded and playback audio frame.

The SDK triggers this callback once every 10 ms.

Parameters
audioFrameSee AudioFrame.

◆ OnPlaybackAudioFrameBeforeMixingHandler()

delegate void agora_gaming_rtc.AudioRawDataManager.OnPlaybackAudioFrameBeforeMixingHandler ( uint  uid,
AudioFrame  audioFrame 
)

Retrieves the audio frame of a specified user before mixing.

The SDK triggers this callback once every 10 ms.

Parameters
uidThe user ID.
audioFrameSee AudioFrame.

◆ GetInstance()

static AudioRawDataManager agora_gaming_rtc.AudioRawDataManager.GetInstance ( IRtcEngine  irtcEngine)
static

◆ ReleaseInstance()

static void agora_gaming_rtc.AudioRawDataManager.ReleaseInstance ( )
static

◆ SetEngine()

void agora_gaming_rtc.AudioRawDataManager.SetEngine ( IRtcEngine  irtcEngine)

◆ SetOnRecordAudioFrameCallback()

override int agora_gaming_rtc.AudioRawDataManager.SetOnRecordAudioFrameCallback ( OnRecordAudioFrameHandler  action)

Listens for the OnRecordAudioFrameHandler delegate.

Note
Parameters
actionThe implementation of the OnRecordAudioFrameHandler delegate.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetOnPlaybackAudioFrameCallback()

override int agora_gaming_rtc.AudioRawDataManager.SetOnPlaybackAudioFrameCallback ( OnPlaybackAudioFrameHandler  action)

Listens for the OnPlaybackAudioFrameHandler delegate.

Note
Parameters
actionThe implementation of the OnPlaybackAudioFrameHandler delegate.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetOnMixedAudioFrameCallback()

override int agora_gaming_rtc.AudioRawDataManager.SetOnMixedAudioFrameCallback ( OnMixedAudioFrameHandler  action)

Listens for the OnMixedAudioFrameHandler delegate.

Note
Parameters
actionThe implementation of the OnMixedAudioFrameHandler delegate.
Returns
  • 0: Success.
  • < 0: Failure.

◆ SetOnPlaybackAudioFrameBeforeMixingCallback()

override int agora_gaming_rtc.AudioRawDataManager.SetOnPlaybackAudioFrameBeforeMixingCallback ( OnPlaybackAudioFrameBeforeMixingHandler  action)

Listens for the OnPlaybackAudioFrameBeforeMixingHandler delegate.

Note
Parameters
actionThe implementation of the OnPlaybackAudioFrameBeforeMixingHandler delegate.
Returns
  • 0: Success.
  • < 0: Failure.

◆ RegisterAudioRawDataObserver()

override int agora_gaming_rtc.AudioRawDataManager.RegisterAudioRawDataObserver ( )
virtual

Registers an audio raw data observer.

Note
Ensure that you call this method before joining a channel.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRawDataManager.

◆ UnRegisterAudioRawDataObserver()

override int agora_gaming_rtc.AudioRawDataManager.UnRegisterAudioRawDataObserver ( )
virtual

UnRegisters the audio raw data observer.

Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRawDataManager.

◆ PullAudioFrame()

override int agora_gaming_rtc.AudioRawDataManager.PullAudioFrame ( IntPtr  audioBuffer,
int  type,
int  samples,
int  bytesPerSample,
int  channels,
int  samplesPerSec,
long  renderTimeMs,
int  avsync_type 
)
virtual

Pulls the remote audio data.

Before calling this method, call the SetExternalAudioSink(enabled: true) method to enable and set the external audio sink.

After a successful method call, the app pulls the decoded and mixed audio data for playback.

Note
  • Once you call the PullAudioFrame method successfully, the app will not retrieve any audio data from the OnPlaybackAudioFrameHandler callback.
  • The difference between the OnPlaybackAudioFrameHandler callback and the PullAudioFrame method is as follows:
    • OnPlaybackAudioFrameHandler: The SDK sends the audio data to the app through this callback. Any delay in processing the audio frames may result in audio jitter.
    • PullAudioFrame: The app pulls the remote audio data. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
Parameters
audioBufferThe data buffer of the audio frame. When the audio frame uses a stereo channel, the data buffer is interleaved. The size of the data buffer is as follows: audioBuffer = samples × channels × bytesPerSample.
typeThe type of the audio frame. See AUDIO_FRAME_TYPE.
samplesThe number of samples per channel in the audio frame.
bytesPerSampleThe number of bytes per audio sample, which is usually 16-bit (2-byte).
channelsThe number of audio channels.
  • 1: Mono
  • 2: Stereo (the data is interleaved)
samplesPerSecThe sample rate.
renderTimeMsThe timestamp of the external audio frame. You can use this parameter for the following purposes:
  • Restore the order of the captured audio frame.
  • Synchronize audio and video frames in video-related scenarios, including where external video sources are used.
avsync_typeThe reserved parameter.
Returns
  • 0: Success.
  • < 0: Failure.

Implements agora_gaming_rtc.IAudioRawDataManager.

◆ EnableRawDataPtrCallback()

override int agora_gaming_rtc.AudioRawDataManager.EnableRawDataPtrCallback ( bool  enable)
virtual

The documentation for this class was generated from the following file: