iDFace access sound messages

The iDFace access controller can play sound messages in response to identification events. The user can choose to keep the feature disabled, use the device's default voice messages or upload their audio files.

Operating mode configuration

Events that have sound messages and their default messages are listed in the table below. In the third column of the table, you can see the name of the parameter that must be used to configure the message of each event and, in the fourth column, the valid entries are presented.

Note: All configuration parameters are part of the buzzer module.

Events Default sound message Parameters valid inputs
Not identified "User Not Identified" audio_message_not_identified disabled, default or custom
Authorized "Access authorized" audio_message_authorized disabled, default or custom
Not authorized "Access Denied" audio_message_not_authorized disabled, default or custom
Wear a mask "Please wear a mask" audio_message_use_mask disabled, default or custom

When entering the disabled entry, the sound response for that event will be disabled. If default is entered, the sound response will be the device's default sound message. And if custom is entered, the sound response will be the audio uploaded by the user.

Request example

This request activates the default audible identification responses.

$.ajax({
    url: "/set_configuration.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify(
        {
            "buzzer": {
                "audio_message_not_identified": "default",
                "audio_message_authorized": "default",
                "audio_message_not_authorized": "default",
                "audio_message_use_mask": "default"
            }
        }
    )
});

Request example

This request disables the sound response.

$.ajax({
    url: "/set_configuration.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify(
        {
            "buzzer": {
                "audio_message_not_identified": "disabled",
                "audio_message_authorized": "disabled",
                "audio_message_not_authorized": "disabled",
                "audio_message_use_mask": "disabled"
            }
        }
    )
});

Change the audio playback volume

In addition to being able to choose the audio, it is possible to choose the volume at which the sound response will be emitted. The parameter responsible for adjusting the volume is audio_message_volume_gain. There are 3 possible volume levels: normal, medium and high. Normal is the factory default volume and it corresponds to the input value 1. Medium corresponds to the value 2 and high corresponds to 3. An request example to adjust the volume is shown below:

Request example

This request sets the volume of sound messages to medium.

$.ajax({
    url: "/set_configuration.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify(
        {
            "buzzer": {
                "audio_message_volume_gain": "2"
            }
        }
    )
});

Custom sound message loading

As mentioned above, it is possible to use custom audios in the identification sound messages. To do this, you need to load the desired audio on the device. The audio can be loaded through the WEB interface or the use of the API.

It is important to note that some care must be taken when loading the audio. Firstly, the supported audio file size limit is 5MB. In addition, when sending the file via API, each request is limited to carrying a maximum of 2MB of data and, therefore, the data must be sent in a fragmented way. The user must separate his audio file into blocks (2MB max) and send each part sequentially, in separate requests. To do this, it must work with the current and total parameters, explained below:

POST /set_audio_access_message.fcgi

Parameters

  • event (string): selects which of the identification events the audio to be sent will be used for. Below are possible input strings (required):
  • not_identified: selects the 'Not identified' event.
  • authorized: selects the 'Authorized' event.
  • not_authorized: selects the 'Not authorized' event.
  • use_mask: selects the 'Use mask' event.
  • current (int): corresponds to the value of the current part of the audio being sent. For example: when submitting an audio file divided into 2 parts, the first submission must have the current value equal to 1 and the second submission equal to 2. (required).
  • total (int): corresponds to the total number of parts that will be sent. For example: using the example of sending a file divided into 2 parts, in this case, the total number of parts is equal to 2, so the total must be equal to 2 (required).

Request example

This request loads the audio file on the device. The request corresponds to the first sending of a file divided into 2 parts.

$.ajax({
    url: "/set_audio_access_message.fcgi?event=authorized&current=1&total=2&session=" + session 
    type: 'POST',
    contentType: 'application/octet-stream',
    data: [bytes do áudio enviado]
});

Download custom sound message

Once the customized sound message is loaded, it is possible to download the message via the embedded WEB interface or API. The request to do this is shown below:

POST /get_audio_access_message

Parameters

  • event (string): selects the identification event whose custom audio is desired. Below are possible input strings (required):
  • not_identified: selects the 'Not identified' event.
  • authorized: selects the 'Authorized' event.
  • not_authorized: selects the 'Not authorized' event.
  • use_mask: selects the 'Use mask' event.

Response

  • If it exists, the audio file will be returned.

Request example

$.ajax({
    url: "/get_audio_access_message.fcgi?session=session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        "event": "authorized"
    })
});

Checking for presence of custom audio on the device

One can check if there is already custom audio loaded in the device. For this, the request below is used:

POST /has_audio_access_messages

Parameters

  • No input parameters

Response

  • not_identified (bool): Returns true if there is already a custom audio file for the "Not identified" event. And returns false otherwise.
  • authorized (bool): Returns true if there is already a custom audio file for the "Authorized" event. And returns false otherwise.
  • not_authorized (bool): Returns true if a custom audio file already exists for the "Not authorized" event. And returns false otherwise.
  • use_mask (bool): Returns true if there is already a custom audio file for the "Use mask" event. And returns false otherwise.

Request example

$.ajax({
    url: "//has_audio_access_messages.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json'
});