Skip to content

Voice Enrollment

Enroll voice for voice recognition.

Authorization

This endpoint requires an API token as Bearer in the Authorization header. Go to Authorization guide for details.

Request (POST)

POST https://api.biometrysolutions.com/api-gateway/enroll/voice

Headers

  • Authorization* - Your API Token.
  • X-User-Fullname* - Pass the full name of end-user that consented to store his biometric data.
  • X-Request-User-Provided-ID (Session id) - Include the session ID to link transactions within a unified group.

Parameters

  • unique_id* (String) - Unique ID for the file.
  • phrase* (String) - Transcription of the digits said in the audio file.
  • voice* (Audio file) - The file that will be used to identify voice in the future.

Responses

The object with data and message fields.

  • data - Status of the enrolled voice.

    • qa_combined - Indicates quality check applied to combined audio. e.g. minimum total frames.
    • qa_list - Each item of the qa_list array corresponds to an audio in the request, in order.
    • status - Status of the enrolled voice.
      • good - The voice was successfully enrolled
      • enrolled - The voice was already enrolled
      • error - The voice could not be enrolled because of an error
      • qafailed - The voice could not be enrolled because the audio failed a quality assurance check
  • message - Message with the status of processed audio.

Response sample:

{
"data": {
"qa_combined": QualityResultList,
"qa_list": [QualityResultList],
"status": "string"
}
"message": "string"
}

Objects

QualityResultList

This item is an array of QualityResult and RecognitionResult.

QualityResult
NameTypeDescription
statusstringIndicates if check passed. Values are either good or fail.
propertystringConfiguration property controlling the threshold.
valuenumberThe actual value calculated from the utterance.
opstringThe comparison operator. If the comparison returns true, the status is good, meaning the check passes. Possible values: <, <=, >, >=, ==, !=.
thresholdnumberThe threshold value.
RecognitionResult
NameTypeDescription
statusstringIndicates if recognition was successful. Values are either good or fail.
propertystringResult indicator.
resultsarrayAn array of RecognitionHypothesis.
RecognitionHypothesis
NameTypeDescription
textstringRaw recognized text.
scorenumberIndicates the relative log probability of this hypothesis.

Sample

Request
curl --location 'https://api.biometrysolutions.com/api-gateway/enroll/voice' \
--header 'X-User-Fullname: John Doe' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJhbGciO...ANYea8r2xOG-Urc' \
--form 'voice=@"/[path to your file]/words.mov"' \
--form 'unique_id="someid"' \
--form 'phrase="one two three four five six seven eight"' \
Response
{
"data": {
"qa_combined": null,
"qa_list": [],
"status": "enrolled"
},
"message": "voice registered successfully"
}