NERtc Unity SDK  V4.5.907
Public Member Functions | List of all members
nertc.IAudioFrameObserver Interface Reference

Public Member Functions

void OnAudioFrameDidRecord (RtcAudioFrame frame)
 
void OnAudioFrameWillPlayback (RtcAudioFrame frame)
 
void OnMixedAudioFrame (RtcAudioFrame frame)
 
void OnPlaybackAudioFrameBeforeMixing (ulong userId, RtcAudioFrame frame, ulong cid)
 

Detailed Description

The voice observer object.
Some APIs allow you to modify the content that data points to in the frame. However, you cannot modify the format. If you need to modify the format, you must call the corresponding setting interface.

Member Function Documentation

◆ OnAudioFrameDidRecord()

void nertc.IAudioFrameObserver.OnAudioFrameDidRecord ( RtcAudioFrame  frame)

Callback called when audio data is captured.

Note
  • Captured audio data supports read/write
  • Callback is triggered when local audio data is captured
Parameters
frameAudio frame.

◆ OnAudioFrameWillPlayback()

void nertc.IAudioFrameObserver.OnAudioFrameWillPlayback ( RtcAudioFrame  frame)

Callback called when audio data is playing.

Note
  • Captured audio data supports read/write
  • Callback is triggered when local audio data is captured
Parameters
frameAudio frame.

◆ OnMixedAudioFrame()

void nertc.IAudioFrameObserver.OnMixedAudioFrame ( RtcAudioFrame  frame)

Callback called when captured audio data is mixed.

Note
  • Captured audio data supports read-only
  • Callback is triggered when local audio data is captured
Parameters
frameAudio frame.

◆ OnPlaybackAudioFrameBeforeMixing()

void nertc.IAudioFrameObserver.OnPlaybackAudioFrameBeforeMixing ( ulong  userId,
RtcAudioFrame  frame,
ulong  cid 
)

Gets the raw audio data of a specified remote user before audio mixing.
After the audio observer is registered, if the remote audio is subscribed by default and the remote user enables the audio, the SDK triggers this callback when the audio data before audio mixing is captured, and the audio data is returned to the user.

Note
The returned audio data is read-only.
Since
V4.5.0
Parameters
userIdThe ID of a remote user.
frameThe audio frame.
cidThe ID of the channel. In multi-channel scenarios, channelId is used to identify different channels.

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