Personal Voices - Create

Creates a new personal voice with audio files in Azure Blob Storage.

PUT {endpoint}/customvoice/personalvoices/{id}?api-version=2023-12-01-preview

URI Parameters

Name In Required Type Description
endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://eastus.api.cognitive.microsoft.com).

id
path True

string

The ID of the resource.

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

api-version
query True

string

The API version to use for this operation.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Provide your Speech resource key here.

Operation-Id

string

ID of the status monitor for the operation. If the Operation-Id header matches an existing operation and the request is not identical to the prior request, it will fail with a 400 Bad Request.

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

Request Body

Name Required Type Description
consentId True

string

Resource id

projectId True

string

Resource id

audios

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

description

string

Personal voice description

displayName

string

Display name of personal voice

id

string

Resource id

status

Status

Status of a resource.

Responses

Name Type Description
201 Created

PersonalVoice

Created

Headers

  • Operation-Id: string
  • Operation-Location: string
Other Status Codes

ErrorResponse

An error occurred.

Security

Ocp-Apim-Subscription-Key

Provide your Speech resource key here.

Type: apiKey
In: header

Examples

Create a personal voice

Sample Request

PUT {endpoint}/customvoice/personalvoices/Jessica-PersonalVoice?api-version=2023-12-01-preview



{
  "projectId": "PersonalVoice",
  "consentId": "Jessica",
  "audios": {
    "containerUrl": "https://contoso.blob.core.windows.net/voicecontainer?mySasToken",
    "prefix": "jessica/",
    "extensions": [
      ".wav"
    ]
  }
}

Sample Response

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/1321a2c0-9be4-471d-83bb-bc3be4f96a6f?api-version=2023-12-01-preview
Operation-Id: 1321a2c0-9be4-471d-83bb-bc3be4f96a6f
{
  "id": "Jessica-PersonalVoice",
  "speakerProfileId": "3059912f-a3dc-49e3-bdd0-02e449df1fe3",
  "projectId": "PersonalVoice",
  "consentId": "Jessica",
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

Definitions

Name Description
AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Error

Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details.

ErrorCode

Top-level error code

ErrorResponse

Error response follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

InnerError

Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested).

ModelFailureReason

Model training failure reason

PersonalVoice

Personal voice object

PersonalVoiceProperties

Personal voice properties

Status

Status of a resource.

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Name Type Description
containerUrl

string

Azure Blob Storage container URL with SAS. Need both read and list permissions.

extensions

string[]

File name extensions.

prefix

string

Blob name prefix.

Error

Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details.

Name Type Description
code

ErrorCode

Top-level error code

details

Error[]

Additional supportive details regarding the error and/or expected policies.

innererror

InnerError

Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested).

message

string

Top-level error message.

target

string

The source of the error. For example it would be "model" or "model id" in case of invalid model.

ErrorCode

Top-level error code

Name Type Description
BadArgument

string

BadRequest

string

Forbidden

string

InternalServerError

string

NotFound

string

ServiceUnavailable

string

TooManyRequests

string

Unauthorized

string

UnsupportedMediaType

string

ErrorResponse

Error response follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors.

Name Type Description
error

Error

Top-level error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains an top-level error with error code, message, details, target and an inner error with more descriptive details.

InnerError

Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested).

Name Type Description
code

string

Detailed error code to help diagnostic.

innererror

InnerError

Inner error follows Microsoft Azure REST API Guidelines which is available at https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors. This contains required properties error code, message and optional properties target, inner error(this can be nested).

message

string

Detailed error message.

target

string

The source of the error. For example it would be "model" or "model id" in case of invalid model.

ModelFailureReason

Model training failure reason

Name Type Description
InaccessibleCustomerStorage

string

Internal

string

None

string

SpeakerVerificationFailed

string

TerminateByUser

string

PersonalVoice

Personal voice object

Name Type Description
audios

AzureBlobContentSource

Azure Blob Storage content. With the examples below, it represents files https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

consentId

string

Resource id

createdDateTime

string

The timestamp when the object was created. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).

description

string

Personal voice description

displayName

string

Display name of personal voice

id

string

Resource id

lastActionDateTime

string

The timestamp when the current status was entered. The timestamp is encoded as ISO 8601 date and time format ("YYYY-MM-DDThh:mm:ssZ", see https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).

projectId

string

Resource id

properties

PersonalVoiceProperties

Personal voice properties

speakerProfileId

string

Personal voice speaker profile id. Fill this property in SSML.

status

Status

Status of a resource.

PersonalVoiceProperties

Personal voice properties

Name Type Description
failureReason

ModelFailureReason

Model training failure reason

Status

Status of a resource.

Name Type Description
Disabled

string

Disabling

string

Failed

string

NotStarted

string

Running

string

Succeeded

string