Compute a voiceprint
In this guide you will learn how to compute a voiceprint of an identity in a space, using an audio. 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
Set up your HTTP client
Use the playground or automatically generate requests from the OpenAPI definition.
Authenticate using your credentials or API keys
Your API requests must be authenticated using your credentials or API keys.
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.
--->βowner
βspace
Create an identity
You must have created an identity in the chosen space.
--->βidentity
Upload an audio
You must have uploaded an audio to the chosen space.
--->βaudio
To focus on the computing of the voiceprint, this guide expects an audio to be uploaded as a prerequisite. However, it is common to upload the audios as part of the voiceprint computing process, which allows for better step-by-step validation.
Procedure
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 audio, you will receive an error when you attempt to add it to the voiceprint.
--->βmodel
βversion
Create the voiceprint
Create the voiceprint for the identity. See the API reference.
<---βowner
βspace
βmodel
βversion
βidentity
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)
- Methodβββ
POST
- Pathβββ
/spaces/{owner}/{space}/identities
- Bodyβββ
application/json
{
"handle": "{voiceprint}",
"model": {
"handle": "{model}",
"version": "{version}"
},
"identity": "{identity}",
"minAudios": 1
}
This guide sets the minimum required audios of the voiceprint to 1. If that does not fit your use case, you will need to repeat step 3 with different audios.
Add the audio
Add the audio to the voiceprint. See the API reference.
<---βowner
βspace
βidentity
βvoiceprint
βaudio
- Methodβββ
POST
- Pathβββ
/spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
ββββββββββ>β/audios/{audio}
If you wish to add more audios to the voiceprint, just repeat this step.
Compute the voiceprint
Compute the voiceprint. See the API reference.
<---βowner
βspace
βidentity
βvoiceprint
--->ββ¦βvoiceprint
β(ready for verifications)
- Methodβββ
POST
- Pathβββ
/spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
ββββββββββ>β:compute
A voiceprint can only be computed once and the operation is irreversible. Audios cannot be added or removed afterwards.
Validation
Validate the voiceprint details
To validate that the voiceprint has been correctly computed, retrieve and analyze its details. See the API reference.
<---βowner
βspace
βidentity
βvoiceprint
- Methodβββ
GET
- Pathβββ
/spaces/{owner}/{space}/voiceprints/{identity}/{voiceprint}
Validate the voiceprint usage 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.
- Methodβββ
GET
- Pathβββ
/orgs/{owner}/records/voiceprint