Skip to content

Commit 1ba7db0

Browse files
Merge pull request #262965 from eric-urban/eur/cnv-personal-voice
personal voice from local files
2 parents b893bd3 + d4b2a21 commit 1ba7db0

File tree

6 files changed

+103
-14
lines changed

6 files changed

+103
-14
lines changed

articles/ai-services/speech-service/includes/previews/preview-personal-voice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ms.author: eric-urban
66
ms.service: azure-ai-services
77
ms.topic: include
8-
ms.date: 12/1/2023
8+
ms.date: 1/10/2024
99
ms.custom: include
1010
---
1111

articles/ai-services/speech-service/personal-voice-create-consent.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: how-to
9-
ms.date: 12/1/2023
9+
ms.date: 1/10/2024
1010
ms.author: eur
1111
---
1212

@@ -16,7 +16,7 @@ ms.author: eur
1616

1717
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.
1818

19-
To add user consent to the personal voice project, you get the prerecorded consent audio file from a publicly accessible URL (`Consents_Create`) or upload the audio file (`Consents_Post`). In this article, you add consent from a URL.
19+
To add user consent to the personal voice project, you provide the prerecorded consent audio file [from a publicly accessible URL](#add-consent-from-a-url) (`Consents_Create`) or [upload the audio file](#add-consent-from-a-file) (`Consents_Post`).
2020

2121
## Consent statement
2222

@@ -28,8 +28,54 @@ You can get the consent statement text for each locale from the text to speech G
2828
"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."
2929
```
3030

31+
## Add consent from a file
32+
33+
In this scenario, the audio files must be available locally.
34+
35+
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:
36+
37+
- Set the required `projectId` property. See [create a project](./personal-voice-create-project.md).
38+
- Set the required `voiceTalentName` property. The voice talent name can't be changed later.
39+
- Set the required `companyName` property. The company name can't be changed later.
40+
- Set the required `audiodata` property with the consent audio file.
41+
- 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](/azure/ai-services/speech-service/language-support?tabs=tts).
42+
43+
Make an HTTP POST request using the URI as shown in the following `Consents_Post` example.
44+
- Replace `YourResourceKey` with your Speech resource key.
45+
- Replace `YourResourceRegion` with your Speech resource region.
46+
- 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.
47+
48+
```azurecli-interactive
49+
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"
50+
```
51+
52+
You should receive a response body in the following format:
53+
54+
```json
55+
{
56+
"id": "JessicaConsentId",
57+
"description": "Consent for Jessica voice",
58+
"projectId": "ProjectId",
59+
"voiceTalentName": "Jessica Smith",
60+
"companyName": "Contoso",
61+
"locale": "en-US",
62+
"status": "NotStarted",
63+
"createdDateTime": "2023-04-01T05:30:00.000Z",
64+
"lastActionDateTime": "2023-04-02T10:15:30.000Z"
65+
}
66+
```
67+
68+
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:
69+
70+
```HTTP 201
71+
Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/070f7986-ef17-41d0-ba2b-907f0f28e314?api-version=2023-12-01-preview
72+
Operation-Id: 070f7986-ef17-41d0-ba2b-907f0f28e314
73+
```
74+
3175
## Add consent from a URL
3276

77+
In this scenario, the audio files must already be stored in an Azure Blob Storage container.
78+
3379
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:
3480

3581
- Set the required `projectId` property. See [create a project](./personal-voice-create-project.md).

articles/ai-services/speech-service/personal-voice-create-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: how-to
9-
ms.date: 12/1/2023
9+
ms.date: 1/10/2024
1010
ms.author: eur
1111
---
1212

articles/ai-services/speech-service/personal-voice-create-voice.md

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: how-to
9-
ms.date: 12/1/2023
9+
ms.date: 1/10/2024
1010
ms.author: eur
1111
---
1212

@@ -18,13 +18,59 @@ To use personal voice in your application, you need to get a speaker profile ID.
1818

1919
You create a speaker profile ID based on the speaker's verbal consent statement and an audio prompt (a clean human voice sample between 50 - 90 seconds). The user's voice characteristics are encoded in the `speakerProfileId` property that's used for text to speech. For more information, see [use personal voice in your application](./personal-voice-how-to-use.md).
2020

21-
## Create personal voice
21+
> [!NOTE]
22+
> The personal voice ID and speaker profile ID aren't same. You can choose the personal voice ID, but the speaker profile ID is generated by the service. The personal voice ID is used to manage the personal voice. The speaker profile ID is used for text to speech.
23+
24+
You provide the audio files [from a publicly accessible URL](#create-personal-voice-from-a-url) (`PersonalVoices_Create`) or [upload the audio files](#create-personal-voice-from-a-file) (`PersonalVoices_Post`).
2225

23-
To create a personal voice and get the speaker profile ID, use the `PersonalVoices_Create` operation of the custom voice API.
26+
## Create personal voice from a file
2427

25-
Before calling this API, please store audio files in Azure Blob. In the example below, audio files are https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav.
28+
In this scenario, the audio files must be available locally.
2629

27-
Construct the request body according to the following instructions:
30+
To create a personal voice and get the speaker profile ID, use the `PersonalVoices_Post` operation of the custom voice API. Construct the request body according to the following instructions:
31+
32+
- Set the required `projectId` property. See [create a project](./personal-voice-create-project.md).
33+
- Set the required `consentId` property. See [add user consent](./personal-voice-create-consent.md).
34+
- Set the required `audiodata` property. You can specify one or more audio files in the same request.
35+
36+
Make an HTTP POST request using the URI as shown in the following `PersonalVoices_Post` example.
37+
- Replace `YourResourceKey` with your Speech resource key.
38+
- Replace `YourResourceRegion` with your Speech resource region.
39+
- Replace `JessicaPersonalVoiceId` with a personal voice ID of your choice. The case sensitive ID will be used in the personal voice's URI and can't be changed later.
40+
41+
```azurecli-interactive
42+
curl -v -X POST -H "Ocp-Apim-Subscription-Key: YourResourceKey" -F 'projectId="ProjectId"' -F 'consentId="JessicaConsentId"' -F 'audiodata=@"D:\PersonalVoiceTest\CNVSample001.wav"' -F 'audiodata=@"D:\PersonalVoiceTest\CNVSample002.wav"' "
43+
https://YourResourceRegion.api.cognitive.microsoft.com/customvoice/personalvoices/JessicaPersonalVoiceId?api-version=2023-12-01-preview"
44+
```
45+
46+
You should receive a response body in the following format:
47+
48+
```json
49+
{
50+
"id": "JessicaPersonalVoiceId",
51+
"speakerProfileId": "3059912f-a3dc-49e3-bdd0-02e449df1fe3",
52+
"projectId": "ProjectId",
53+
"consentId": "JessicaConsentId",
54+
"status": "NotStarted",
55+
"createdDateTime": "2023-04-01T05:30:00.000Z",
56+
"lastActionDateTime": "2023-04-02T10:15:30.000Z"
57+
}
58+
```
59+
60+
Use the `speakerProfileId` property to integrate personal voice in your text to speech application. For more information, see [use personal voice in your application](./personal-voice-how-to-use.md).
61+
62+
The response header contains the `Operation-Location` property. Use this URI to get details about the `PersonalVoices_Post` operation. Here's an example of the response header:
63+
64+
```HTTP 201
65+
Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/1321a2c0-9be4-471d-83bb-bc3be4f96a6f?api-version=2023-12-01-preview
66+
Operation-Id: 1321a2c0-9be4-471d-83bb-bc3be4f96a6f
67+
```
68+
69+
## Create personal voice from a URL
70+
71+
In this scenario, the audio files must already be stored in an Azure Blob Storage container.
72+
73+
To create a personal voice and get the speaker profile ID, use the `PersonalVoices_Create` operation of the custom voice API. Construct the request body according to the following instructions:
2874

2975
- Set the required `projectId` property. See [create a project](./personal-voice-create-project.md).
3076
- Set the required `consentId` property. See [add user consent](./personal-voice-create-consent.md).
@@ -33,9 +79,6 @@ Construct the request body according to the following instructions:
3379
- Set the required `extensions` property to the extensions of the audio files.
3480
- Optionally, set the `prefix` property to set a prefix for the blob name.
3581

36-
> [!NOTE]
37-
> The personal voice ID and speaker profile ID aren't same. You can choose the personal voice ID, but the speaker profile ID is generated by the service. The personal voice ID is used to manage the personal voice. The speaker profile ID is used for text to speech.
38-
3982
Make an HTTP PUT request using the URI as shown in the following `PersonalVoices_Create` example.
4083
- Replace `YourResourceKey` with your Speech resource key.
4184
- Replace `YourResourceRegion` with your Speech resource region.

articles/ai-services/speech-service/personal-voice-how-to-use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: overview
9-
ms.date: 11/15/2023
9+
ms.date: 1/10/2024
1010
ms.author: eur
1111
ms.custom: references_regions
1212
---

articles/ai-services/speech-service/personal-voice-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: eric-urban
66
manager: nitinme
77
ms.service: azure-ai-speech
88
ms.topic: overview
9-
ms.date: 12/1/2023
9+
ms.date: 1/10/2024
1010
ms.author: eur
1111
ms.custom: references_regions
1212
---

0 commit comments

Comments
 (0)