In this guide you will learn how to compute a voiceprint of an identity in a space, using a voice sample. This is a prerequisite to perform identity verifications.

If you are unfamiliar with these concepts, follow their links or read the API reference introduction.

✦ Goal: compute a voiceprint and store its reference for future use.

Prerequisites

1

Set up your HTTP client

Use the playground or automatically generate requests from the OpenAPI definition.

2

Authenticate using your credentials or API keys

Your API requests must be authenticated using your credentials or API keys.

3

Gain access to a space

You can only operate in spaces that belong to your user or to one of your organizations. Review these relationships if your access is denied.

---> ownerspace

4

Create an identity

You must have created an identity in the chosen space.

---> identity

5

Upload a voice sample

You must have uploaded a voice sample to the chosen space.

---> sample

To focus on the computing of the voiceprint, this guide expects a voice sample to be uploaded as a prerequisite. However, it is common to upload the voice samples as part of the voiceprint computing process, which allows for better step-by-step validation.

Procedure

1

Choose the voiceprint model

Check the available models and choose the one you will use to compute the voiceprint. See the model index.

Each model has its own requirements. If you do not choose an appropriate one for your voice sample, you will receive an error when you attempt to add it to the voiceprint.

---> modelversion

2

Create the voiceprint

Create the voiceprint for the identity. See the API reference.

<--- ownerspacemodelversionidentity

You must choose the handle for the voiceprint. Optionally, you may choose the alias.

It is not recommended to use globally unique handles for voiceprints. Instead, use a predictable pattern. A good starting point is to have a main voiceprint for each identity.

---> voiceprint (not yet ready for verifications)

  • Request

  • Response

  • Method — POST
  • Path — /spaces/{owner}/{space}/identities
  • Body — application/json
{
  "handle": "{voiceprint}",
  "model": {
    "handle": "{model}",
    "version": "{version}"
  },
  "identity": "{identity}",
  "minSamples": 1
}

This guide sets the minimum required voice samples of the voiceprint to 1. If that does not fit your use case, you will need to repeat step 3 with different voice samples.

3

Add the voice sample

Add the voice sample to the voiceprint. See the API reference.

<--- ownerspaceidentityvoiceprintsample

  • Request

  • Response

  • Method — POST
  • Path — /spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
             —> /samples/{sample}

If you wish to add more voice samples to the voiceprint, just repeat this step.

4

Compute the voiceprint

Compute the voiceprint. See the API reference.

<--- ownerspaceidentityvoiceprint

---> ✦ voiceprint (ready for verifications)

  • Request

  • Response

  • Method — POST
  • Path — /spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
             —> :compute

A voiceprint can only be computed once and the operation is irreversible. Voice samples cannot be added or removed afterwards.

Validation

1

Validate the voiceprint details

To validate that the voiceprint has been correctly computed, retrieve and analyze its details. See the API reference.

<--- ownerspaceidentityvoiceprint

  • Request

  • Response

  • Method — GET
  • Path — /spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
2

Validate the voiceprint records

To validate that the voiceprint has been correctly computed, retrieve and analyze the voiceprint usage records. See the API reference.

<--- owner

This step assumes that the owner is an organization. If you are the owner, you must use a slightly different endpoint. See the API reference.

  • Request

  • Response

  • Method — GET
  • Path — /orgs/{owner}/records/voiceprint