Add user consent to the personal voice (preview) project

Note

Personal voice for text to speech is currently in public preview. This preview is provided without a service-level agreement, and is not recommended for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.

With the personal voice feature, it's required that every voice be created with explicit consent from the user. A recorded statement from the user is required acknowledging that the customer (Azure AI Speech resource owner) will create and use their voice.

To add user consent to the personal voice project, you provide the prerecorded consent audio file from a publicly accessible URL (Consents_Create) or upload the audio file (Consents_Post).

You need an audio recording of the user speaking the consent statement.

You can get the consent statement text for each locale from the text to speech GitHub repository. See verbal-statement-all-locales.txt for the consent statement. Below is a sample for the en-US locale:

"I  [state your first and last name] am aware that recordings of my voice will be used by [state the name of the company] to create and use a synthetic version of my voice."

In this scenario, the audio files must be available locally.

To add consent to a personal voice project from a local audio file, use the Consents_Post operation of the custom voice API. Construct the request body according to the following instructions:

  • Set the required projectId property. See create a project.
  • Set the required voiceTalentName property. The voice talent name can't be changed later.
  • Set the required companyName property. The company name can't be changed later.
  • Set the required audiodata property with the consent audio file.
  • Set the required locale property. This should be the locale of the consent. The locale can't be changed later. You can find the text to speech locale list here.

Make an HTTP POST request using the URI as shown in the following Consents_Post example.

  • Replace YourResourceKey with your Speech resource key.
  • Replace YourResourceRegion with your Speech resource region.
  • Replace JessicaConsentId with a consent ID of your choice. The case sensitive ID will be used in the consent's URI and can't be changed later.
curl -v -X POST -H "Ocp-Apim-Subscription-Key: YourResourceKey" -F 'description="Consent for Jessica voice"' -F 'projectId="ProjectId"' -F 'voiceTalentName="Jessica Smith"' -F 'companyName="Contoso"' -F 'audiodata=@"D:\PersonalVoiceTest\jessica-consent.wav"' -F 'locale="en-US"' "https://YourResourceRegion.api.cognitive.microsoft.com/customvoice/consents/JessicaConsentId?api-version=2023-12-01-preview"

You should receive a response body in the following format:

{
  "id": "JessicaConsentId",
  "description": "Consent for Jessica voice",
  "projectId": "ProjectId",
  "voiceTalentName": "Jessica Smith",
  "companyName": "Contoso",
  "locale": "en-US",
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

The response header contains the Operation-Location property. Use this URI to get details about the Consents_Post operation. Here's an example of the response header:

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/070f7986-ef17-41d0-ba2b-907f0f28e314?api-version=2023-12-01-preview
Operation-Id: 070f7986-ef17-41d0-ba2b-907f0f28e314

In this scenario, the audio files must already be stored in an Azure Blob Storage container.

To add consent to a personal voice project from the URL of an audio file, use the Consents_Create operation of the custom voice API. Construct the request body according to the following instructions:

  • Set the required projectId property. See create a project.
  • Set the required voiceTalentName property. The voice talent name can't be changed later.
  • Set the required companyName property. The company name can't be changed later.
  • Set the required audioUrl property. The URL of the voice talent consent audio file. Use a URI with the shared access signatures (SAS) token.
  • Set the required locale property. This should be the locale of the consent. The locale can't be changed later. You can find the text to speech locale list here.

Make an HTTP PUT request using the URI as shown in the following Consents_Create example.

  • Replace YourResourceKey with your Speech resource key.
  • Replace YourResourceRegion with your Speech resource region.
  • Replace JessicaConsentId with a consent ID of your choice. The case sensitive ID will be used in the consent's URI and can't be changed later.
curl -v -X PUT -H "Ocp-Apim-Subscription-Key: YourResourceKey" -H "Content-Type: application/json" -d '{
  "description": "Consent for Jessica voice",
  "projectId": "ProjectId",
  "voiceTalentName": "Jessica Smith",
  "companyName": "Contoso",
  "audioUrl": "https://contoso.blob.core.windows.net/public/jessica-consent.wav?mySasToken",
  "locale": "en-US"
} '  "https://YourResourceRegion.api.cognitive.microsoft.com/customvoice/consents/JessicaConsentId?api-version=2023-12-01-preview"

You should receive a response body in the following format:

{
  "id": "JessicaConsentId",
  "description": "Consent for Jessica voice",
  "projectId": "ProjectId",
  "voiceTalentName": "Jessica Smith",
  "companyName": "Contoso",
  "locale": "en-US",
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

The response header contains the Operation-Location property. Use this URI to get details about the Consents_Create operation. Here's an example of the response header:

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/070f7986-ef17-41d0-ba2b-907f0f28e314?api-version=2023-12-01-preview
Operation-Id: 070f7986-ef17-41d0-ba2b-907f0f28e314

Next steps