你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Personal Voices - Create

在 Azure Blob 存储中使用音频文件创建新的个人语音。

PUT {endpoint}/customvoice/personalvoices/{id}?api-version=2024-02-01-preview

URI 参数

名称 必需 类型 说明
endpoint
path True

string

支持的认知服务终结点(协议和主机名,例如:https://eastus.api.cognitive.microsoft.com)。

id
path True

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源的 ID。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

在此处提供语音资源密钥。

Operation-Id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

作的状态监视器的 ID。 如果 Operation-Id 标头与现有作匹配,并且请求与以前的请求不同,则请求将失败并出现 400 错误请求。

请求正文

名称 必需 类型 说明
consentId True

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

projectId True

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

audios

AzureBlobContentSource

Azure Blob 存储内容。 在下面的示例中,它表示文件 https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

description

string

个人语音说明

displayName

string

minLength: 1

个人语音的显示名称

id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

status

Status

资源的状态。

响应

名称 类型 说明
201 Created

PersonalVoice

创建

标头

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

ErrorResponse

发生错误。

标头

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

在此处提供语音资源密钥。

类型: apiKey
在: header

示例

Create a personal voice

示例请求

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



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

示例响应

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/1321a2c0-9be4-471d-83bb-bc3be4f96a6f?api-version=2024-02-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"
}

定义

名称 说明
AzureBlobContentSource

Azure Blob 存储内容。 在下面的示例中,它表示文件 https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

ErrorCode

顶级错误代码

ErrorResponse

错误响应遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

ModelFailureReason

模型训练失败原因

PersonalVoice

个人语音对象

PersonalVoiceProperties

个人语音属性

Status

资源的状态。

AzureBlobContentSource

Azure Blob 存储内容。 在下面的示例中,它表示文件 https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

名称 类型 说明
containerUrl

string (url)

具有 SAS的 Azure Blob 存储容器 URL。 需要读取权限和列表权限。

extensions

string[]

文件扩展名。

prefix

string

Blob 名称前缀。

Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

名称 类型 说明
code

ErrorCode

顶级错误代码

details

Error[]

有关错误和/或预期策略的其他支持详细信息。

innererror

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

message

string

顶级错误消息。

target

string

错误的源。 例如,如果模型无效,则为“model”或“model id”。

ErrorCode

顶级错误代码

说明
BadRequest
BadArgument
Unauthorized
Forbidden
NotFound
UnsupportedMediaType
TooManyRequests
InternalServerError
ServiceUnavailable

ErrorResponse

错误响应遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。

名称 类型 说明
error

Error

顶级错误遵循Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含一个顶级错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

名称 类型 说明
code

string

用于帮助诊断的详细错误代码。

innererror

InnerError

内部错误遵循 Microsoft Azure REST API 指南,https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors提供。 这包含必需的属性错误代码、消息和可选属性目标、内部错误(可嵌套)。

message

string

详细的错误消息。

target

string

错误的源。 例如,如果模型无效,则为“model”或“model id”。

ModelFailureReason

模型训练失败原因

说明
InaccessibleCustomerStorage

客户使用语音帐户中的“自带存储”。 但是,现在无法访问存储。 请检查 文档

SpeakerVerificationFailed

同意和培训音频不是来自同一说话人。

TerminateByUser

客户取消了模型训练。

Internal

自定义语音服务错误。

PersonalVoice

个人语音对象

名称 类型 说明
audios

AzureBlobContentSource

Azure Blob 存储内容。 在下面的示例中,它表示文件 https://contoso.blob.core.windows.net/voicecontainer/jessica/*.wav

consentId

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

createdDateTime

string (date-time)

创建对象的时间戳。 时间戳编码为 ISO 8601 日期和时间格式(“YYYY-MM-DDThh:mm:ssZ”,请参阅 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。

description

string

个人语音说明

displayName

string

minLength: 1

个人语音的显示名称

id

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

lastActionDateTime

string (date-time)

输入当前状态时的时间戳。 时间戳编码为 ISO 8601 日期和时间格式(“YYYY-MM-DDThh:mm:ssZ”,请参阅 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。

projectId

string

minLength: 3
maxLength: 64
pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]{1,62}[a-zA-Z0-9]$

资源 ID

properties

PersonalVoiceProperties

个人语音属性

speakerProfileId

string (uuid)

个人语音扬声器配置文件 ID。在 SSML 中填充此属性。

status

Status

资源的状态。

PersonalVoiceProperties

个人语音属性

名称 类型 说明
failureReason

ModelFailureReason

模型训练失败原因

Status

资源的状态。

说明
NotStarted
Running
Succeeded
Failed
Disabling
Disabled