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

Playing an Audio File

This API is used to play a local audio file in AAC format. Connect a headset or sound box to the audio output port of the HiLens Kit device. You can hear the sound calling this API.

  • API calling

    hilens.play_aac_file(file_path, vol)

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    file_path

    Yes

    Character string

    Absolute path of the local audio file

    vol

    Yes

    Integer

    Volume of the audio file to be played. The value range is [-121, 6].

  • Return value

    If the operation is successful, 0 is returned. Otherwise, the operation fails.