class AgoraAudioFrameObserverWrapper extends java.lang.Object implements IAudioFrameObserver
| Modifier and Type | Field and Description |
|---|---|
private IAudioFrameObserver |
audioFrameObserver
The wrapped audio frame observer
|
private boolean |
enableVad
Whether VAD is enabled
|
private AgoraAudioVadManager |
vadManager
VAD manager instance
|
private VadProcessResult |
vadProcessResult
VAD processing result
|
| Constructor and Description |
|---|
AgoraAudioFrameObserverWrapper(IAudioFrameObserver observer,
boolean enableVad,
AgoraAudioVadConfigV2 vadConfig,
AgoraServiceConfig agoraServiceConfig)
Constructs an AgoraAudioFrameObserverWrapper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroys the wrapper and releases resources.
|
int |
getObservedAudioFramePosition()
Gets the observed audio frame position.
|
int |
onEarMonitoringAudioFrame(AgoraLocalUser agoraLocalUser,
AudioFrame frame)
Note: To improve data transmission efficiency, the buffer of the frame object
is a DirectByteBuffer.
|
int |
onMixedAudioFrame(AgoraLocalUser agoraLocalUser,
java.lang.String channelId,
AudioFrame frame)
Note: To improve data transmission efficiency, the buffer of the frame object
is a DirectByteBuffer.
|
int |
onPlaybackAudioFrame(AgoraLocalUser agoraLocalUser,
java.lang.String channelId,
AudioFrame frame)
Note: To improve data transmission efficiency, the buffer of the frame object
is a DirectByteBuffer.
|
int |
onPlaybackAudioFrameBeforeMixing(AgoraLocalUser agoraLocalUser,
java.lang.String channelId,
java.lang.String userId,
AudioFrame frame,
VadProcessResult vadResult)
Note: To improve data transmission efficiency, the buffer of the frame object
is a DirectByteBuffer.
|
int |
onRecordAudioFrame(AgoraLocalUser agoraLocalUser,
java.lang.String channelId,
AudioFrame frame)
Note: To improve data transmission efficiency, the buffer of the frame object
is a DirectByteBuffer.
|
private volatile IAudioFrameObserver audioFrameObserver
private volatile boolean enableVad
private volatile AgoraAudioVadManager vadManager
private volatile VadProcessResult vadProcessResult
public AgoraAudioFrameObserverWrapper(IAudioFrameObserver observer, boolean enableVad, AgoraAudioVadConfigV2 vadConfig, AgoraServiceConfig agoraServiceConfig)
observer - Audio frame observerenableVad - Whether to enable VADvadConfig - VAD configurationagoraServiceConfig - Agora service configurationpublic void destroy()
public int onRecordAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)
IAudioFrameObserverUtils.getBytes(ByteBuffer).onRecordAudioFrame in interface IAudioFrameObserveragoraLocalUser - the local userchannelId - the channel idframe - the audio framepublic int onPlaybackAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)
IAudioFrameObserverUtils.getBytes(ByteBuffer).onPlaybackAudioFrame in interface IAudioFrameObserveragoraLocalUser - the local userchannelId - the channel idframe - the audio framepublic int onMixedAudioFrame(AgoraLocalUser agoraLocalUser, java.lang.String channelId, AudioFrame frame)
IAudioFrameObserverUtils.getBytes(ByteBuffer).onMixedAudioFrame in interface IAudioFrameObserveragoraLocalUser - the local userchannelId - the channel idframe - the audio framepublic int onEarMonitoringAudioFrame(AgoraLocalUser agoraLocalUser, AudioFrame frame)
IAudioFrameObserverUtils.getBytes(ByteBuffer).onEarMonitoringAudioFrame in interface IAudioFrameObserveragoraLocalUser - the local userframe - the audio framepublic int onPlaybackAudioFrameBeforeMixing(AgoraLocalUser agoraLocalUser, java.lang.String channelId, java.lang.String userId, AudioFrame frame, VadProcessResult vadResult)
IAudioFrameObserverUtils.getBytes(ByteBuffer).onPlaybackAudioFrameBeforeMixing in interface IAudioFrameObserveragoraLocalUser - the local userchannelId - the channel iduserId - the user idframe - the audio framevadResult - the vad resultpublic int getObservedAudioFramePosition()
IAudioFrameObservergetObservedAudioFramePosition in interface IAudioFrameObserver