8 Package of Ingenic Audio Collection

overview

        In IPC, it is necessary to collect the sound from the device, encode it, and then send it to the client or monitoring platform. The audio function in Ingenic SDK includes 5 modules, namely: audio input, audio output, echo cancellation, audio encoding and audio decoding. Among them, audio input and audio output have the concept of device (Device) and channel (Channel). A MIC is considered as a recording device, and a MIC can have multiple Channel inputs. Similarly, an SPK is considered as a playback device, and an SPK can also have multiple Channel outputs. In the current version of the audio API, a Device only supports one Channel.

        Audio codec is divided into: internal codec and external codec, internal codec is divided into: digital dmic and analog amic. At present, Ingenic's audio API only supports audio encoding algorithms in formats such as G711A, G711U, ADPCM, and G726. If you need to support new encoding algorithms, you can register a custom audio encoder through the internal registration mechanism (register custom audio encoding device, which was introduced in the previous chapter). One thing needs special attention: the ADPCM encoding algorithm supported by Ingenic SDK is ADPCM_ORG_DVI4 format, which is not compatible with ADPCM_DVI format commonly used in security monitoring. In the encapsulation of the underlying API interface introduced in the previous sections, the ADPCM_DVI format encoding algorithm has been supported through the registration mechanism, and the AAC encoding algorithm has been supported.

Audio collection interface class

        Compared with the video capture interface, the audio capture interface is much simpler. The audio collection interface class mainly includes the following interfaces:

        1. Initialization interface, used to pass in initialization parameters.

        2. Enable audio encoding. When enabled, encoded audio frames will be provided to the application layer through the callback function in the initialization parameters.

        3. Disable audio encoding.

        4. Set encoding information &

Guess you like

Origin blog.csdn.net/hope_wisdom/article/details/131747554