hi_mpi_aenc_get_stream

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Description

Obtains an encoded audio stream.

Restrictions

  • A stream can be obtained only after a channel has been created by calling hi_mpi_aenc_create_chn. Otherwise, an error code indicating failure is returned.
  • This API and hi_mpi_aenc_release_stream must appear in pairs. Call this API to obtain a stream. After the stream is used, call hi_mpi_aenc_release_stream to release the stream in time.

Prototype

hi_s32 hi_mpi_aenc_get_stream(hi_aenc_chn aenc_chn, hi_audio_stream *stream, hi_s32 milli_sec);

Parameters

Parameter

Input/Output

Description

aenc_chn

Input

Encoding channel ID. The value range is [0, 6).

stream

Output

Obtained audio stream.

milli_sec

Input

Timeout interval for obtaining data (ms).

  • -1: blocking mode. The wait is infinite if there is no data.
  • 0: non-blocking mode. An error is returned if there is no data.
  • > 0: A specific timeout interval needs to be configured. If no data is found after the specified interval, an error is returned.

Returns