Updated on 2022-02-22 GMT+08:00

Reading Audio Data

This API is used to read n frames of audio data. Only 1.0.8 and later firmware versions are supported.

  • API calling

    hilens.AudioCapture.read(nFrames)

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    nFrames

    No

    Integer

    Number of frames that are read. The default value is 1. A maximum of 512 frames can be read at a time.

  • Return value

    n frames of audio data. The parameter type is NumPy array (dtype is int16).

    If the read fails, "RunTimeError" is reported.