Skip to content

NET_SDK_DecodeAudioFrame

Interface Definition

1
2
3
4
5
6
BOOL NET_SDK_DecodeAudioFrame(
    POINTERHANDLE lDecHandle,
    unsigned char* pInBuffer,
    LONG inLen,
    unsigned char* pOutBuffer,
    int* pOutLen);
1
2
3
4
5
6
public static extern bool NET_SDK_DecodeAudioFrame(
    POINTERHANDLE lDecodeHandle,
    IntPtr pInBuffer,
    UInt32 inLen,
    IntPtr pOutBuffer,
    ref int pOutLen);

Function Description

Audio decoding.

Parameter Description

Parameters Type Remark
lDecHandlein POINTERHANDLE Audio encoder handle, the return value of NET_SDK_InitAudioDecoder.
pInBufferin unsigned char* Input buffer, PCM audio data obtained according to the sampling standard (sampling frequency is 16000, 16-bit sampling, single channel), and the size of the input data is specified to be 1280 bytes.
inLenout LONG Output buffer, encoded data length.
pOutBufferout unsigned char* Output buffer, the encoded output data size is 80 bytes.
pOutLenout int* Output buffer, the length of the encoded output data.

Return Value

  • type:BOOL

  • remark:Returns TRUE if successful, FALSE if failed.

Remarks

It is mainly set to cooperate with the voice intercom and forwarding functions. When the original audio data of the client needs to be sent to the device, the audio encoding function can be used to compress and encode the original data before sending it to the device. The client obtains the compressed code stream sent by the device and can call the audio decoding function NET_SDK_DecodeAudioFrame to decode the data. Before calling the encoding and decoding function, you need to do the corresponding initialization operation, and after the call, you need to release the resources.

Error Code