◆ AUDIO_FRAME_TYPE
The frame type.
Enumerator |
---|
FRAME_TYPE_PCM16 | 0: PCM16.
|
◆ IAudioFrameObserver()
agora::media::IAudioFrameObserver::IAudioFrameObserver |
( |
| ) |
|
|
inline |
◆ ~IAudioFrameObserver()
virtual agora::media::IAudioFrameObserver::~IAudioFrameObserver |
( |
| ) |
|
|
inlinevirtual |
◆ onRecordAudioFrame()
virtual bool agora::media::IAudioFrameObserver::onRecordAudioFrame |
( |
AudioFrame & |
audioFrame | ) |
|
|
pure virtual |
Gets the captured audio frame.
- Note
- To ensure that the captured audio frame has the expected format, Agora recommends that you call setRecordingAudioFrameParameters after calling registerAudioFrameObserver to set the audio capturing format.
- Parameters
-
- Returns
- true: Reserved for future use.
- false: Reserved for future use.
◆ onPlaybackAudioFrame()
virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrame |
( |
AudioFrame & |
audioFrame | ) |
|
|
pure virtual |
Gets the audio playback frame for getting the audio.
- Note
- To ensure that the audio playback frame has the expected format, Agora recommends that you call setPlaybackAudioFrameParameters after calling registerAudioFrameObserver to set the audio playback format.
- Parameters
-
- Returns
- true: Reserved for future use.
- false: Reserved for future use.
◆ onMixedAudioFrame()
virtual bool agora::media::IAudioFrameObserver::onMixedAudioFrame |
( |
AudioFrame & |
audioFrame | ) |
|
|
pure virtual |
Gets the mixed captured and playback audio frame.
- Note
-
- Parameters
-
- Returns
- true: Reserved for future use.
- false: Reserved for future use.
◆ onPlaybackAudioFrameBeforeMixing()
virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing |
( |
unsigned int |
uid, |
|
|
AudioFrame & |
audioFrame |
|
) |
| |
|
pure virtual |
◆ isMultipleChannelFrameWanted()
virtual bool agora::media::IAudioFrameObserver::isMultipleChannelFrameWanted |
( |
| ) |
|
|
inlinevirtual |
Determines whether to receive audio data from multiple channels.
- Since
- v3.0.1
After you register the audio frame observer, the SDK triggers this callback every time it captures an audio frame.
In the multi-channel scenario, if you want to get audio data from multiple channels, set the return value of this callback as true. After that, the SDK triggers the onPlaybackAudioFrameBeforeMixingEx callback to send you the before-mixing audio data from various channels. You can also get the channel ID of each audio frame.
- Note
- Once you set the return value of this callback as true, the SDK triggers only the onPlaybackAudioFrameBeforeMixingEx callback to send the before-mixing audio frame. onPlaybackAudioFrameBeforeMixing is not triggered. In the multi-channel scenario, Agora recommends setting the return value as true.
- If you set the return value of this callback as false, the SDK triggers only the
onPlaybackAudioFrameBeforeMixing
callback to send the audio data.
- Returns
true
: Receive audio data from multiple channels.
false
: Do not receive audio data from multiple channels.
◆ onPlaybackAudioFrameBeforeMixingEx()
virtual bool agora::media::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixingEx |
( |
const char * |
channelId, |
|
|
unsigned int |
uid, |
|
|
AudioFrame & |
audioFrame |
|
) |
| |
|
inlinevirtual |
Gets the before-mixing playback audio frame from multiple channels.
After you successfully register the audio frame observer, if you set the return value of isMultipleChannelFrameWanted as true, the SDK triggers this callback each time it receives a before-mixing audio frame from any of the channel.
- Note
- To ensure that the audio playback frame has the expected format, Agora recommends that you call setPlaybackAudioFrameParameters after calling registerAudioFrameObserver to set the audio playback format.
- Parameters
-
channelId | The channel ID of this audio frame. |
uid | The ID of the user sending this audio frame. |
audioFrame | The pointer to AudioFrame. |
- Returns
true
: Reserved for future use.
false
: Reserved for future use.