Help Center/ Meeting/ Client SDK Reference/ Electron SDK/ APIs/ Common Configuration Management Objects/ Subscribing to Notifications of Reporting Audio Stream Frame Data
Updated on 2024-07-30 GMT+08:00

Subscribing to Notifications of Reporting Audio Stream Frame Data

Function

A notification is sent when audio stream frame data starts to be reported. (For Windows, only 32-bit Windows is supported.)

Function Prototype

setOnAudioFrameNotifyCB(onAudioFrameNotify: (audioFrameData: AudioFrameData) => void): voidsetOnAudioFrameNotifyCB(onAudioFrameNotify: (audioFrameData: AudioFrameData) => void): void

Request Parameters

Table 1 Input parameter description
Parameter Mandatory Type Description
onAudioFrameNotify Yes (audioFrameData: AudioFrameData) => void Notifies you when audio stream frame data starts to be reported. (For Windows, only 32-bit Windows is supported.)

Return Values

void

Notification Method Parameters

(audioFrameData: AudioFrameData) => void

Table 2 Input parameter description
Parameter Type Description
audioFrameData AudioFrameData Audio stream frame data.
Table 3 AudioFrameData
Parameter Type Description
eFrameType AudioFrameType Audio frame type.
iSamples number Number of sampling points of each audio channel. iSamples = iSamplesPerSec x 10 ms/1,000
iSamplesPerSec number Sampling ratio.
iBytesPerSample number Number of bytes of each sampling point. Generally, the PCM audio is 16 bits.
iChannels number Number of audio channels.
uiBufferLen number Buffer length. The encoded data is encrypted by a third party. The data length increases to prevent overflow.
pBuffer HWM_CHAR * Data buffer. Length = iSamples x iBytesPerSample x iChannels
uiDataLen number Data length, which is used after encoding or before decoding. The value of this parameter needs to be updated after encryption or decryption.
Table 4 Enumerated values of AudioFrameType
Enumeration Name Enumerated Value Description
HWM_AUDIO_FRAME_TYPE_PCM16 0 16-bit PCM.