共用方式為


Models - Create

建立新的語音模型。

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

URI 參數

名稱 位於 必要 類型 Description
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]$

資源的標識碼。

api-version
query True

string

minLength: 1

要用於這項作業的 API 版本。

要求標頭

名稱 必要 類型 Description
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]$

作業的狀態監視器標識碼。 如果 Operation-Id 標頭符合現有的作業,且要求與先前的要求不相同,則會失敗併產生 400 錯誤的要求。

要求本文

名稱 必要 類型 Description
consentId True

string

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

資源標識碼

projectId True

string

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

資源標識碼

recipe True

Recipe

模型建置的配方。 不同的食譜有不同的功能。

trainingSetId True

string

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

資源標識碼

description

string

模型描述

id

string

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

資源標識碼

locale

string

此模型的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡找到文字到語音轉換的地區設定清單,https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts

properties

ModelProperties

模型屬性

status

Status

資源的狀態。

voiceName

string

minLength: 1

語音名稱

回應

名稱 類型 Description
201 Created

Model

創建

標題

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

ErrorResponse

發生錯誤。

標題

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

在這裡提供您的語音資源金鑰。

類型: apiKey
位於: header

範例

Create a model
Create a multi style model

Create a model

範例要求

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



{
  "voiceName": "JessicaNeural",
  "description": "Jessica voice",
  "recipe": {
    "kind": "Default"
  },
  "projectId": "Jessica",
  "consentId": "Jessica",
  "trainingSetId": "Jessica-300"
}

範例回覆

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/1f4352df-f247-40c0-a7b1-a54d017933e1?api-version=2024-02-01-preview
Operation-Id: 1f4352df-f247-40c0-a7b1-a54d017933e1
{
  "id": "Jessica",
  "voiceName": "JessicaNeural",
  "description": "Jessica voice",
  "recipe": {
    "kind": "Default",
    "version": "V7.2023.03"
  },
  "projectId": "Jessica",
  "consentId": "Jessica",
  "trainingSetId": "Jessica-300",
  "locale": "en-US",
  "engineVersion": "2023.07.04.0",
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

Create a multi style model

範例要求

PUT {endpoint}/customvoice/models/JessicaMultiStyle?api-version=2024-02-01-preview



{
  "voiceName": "JessicaMultiStyleNeural",
  "description": "Jessica multi style voice",
  "recipe": {
    "kind": "MultiStyle"
  },
  "projectId": "Jessica",
  "consentId": "Jessica",
  "trainingSetId": "Jessica-300",
  "locale": "en-US",
  "properties": {
    "presetStyles": [
      "cheerful",
      "sad"
    ],
    "styleTrainingSetIds": {
      "happy": "JessicaHappy-300",
      "myStyle2": "JessicaStyle2"
    }
  }
}

範例回覆

Operation-Location: https://eastus.api.cognitive.microsoft.com/customvoice/operations/a01a127a-c204-4e46-a8c1-fab01559b05b?api-version=2024-02-01-preview
Operation-Id: a01a127a-c204-4e46-a8c1-fab01559b05b
{
  "id": "JessicaMultiStyle",
  "voiceName": "JessicaMultiStyleNeural",
  "description": "Jessica multi style voice",
  "recipe": {
    "kind": "MultiStyle",
    "version": "V3.2023.06"
  },
  "projectId": "Jessica",
  "consentId": "Jessica",
  "trainingSetId": "Jessica-300",
  "locale": "en-US",
  "engineVersion": "2023.07.04.0",
  "properties": {
    "presetStyles": [
      "cheerful",
      "sad"
    ],
    "styleTrainingSetIds": {
      "happy": "JessicaHappy-300",
      "myStyle2": "JessicaStyle2"
    },
    "voiceStyles": [
      "cheerful",
      "sad",
      "happy",
      "myStyle2"
    ]
  },
  "status": "NotStarted",
  "createdDateTime": "2023-04-01T05:30:00.000Z",
  "lastActionDateTime": "2023-04-02T10:15:30.000Z"
}

定義

名稱 Description
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提供。 這包括必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤(這可以是巢狀的)。

Model

Model 物件

ModelFailureReason

模型定型失敗原因

ModelProperties

模型屬性

PresetStyleItem

食譜支援的預設樣式。 語音模型可以支持這些樣式,而不需要任何樣式定型集。

Recipe

模型建置的配方。 不同的食譜有不同的功能。

Status

資源的狀態。

Error

最上層錯誤遵循 Microsoft Azure REST API 指導方針,可在 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors取得。 這包含具有錯誤碼、訊息、詳細數據、目標和具有更描述性詳細數據的內部錯誤的最上層錯誤。

名稱 類型 Description
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

最上層錯誤碼

Description
BadArgument
BadRequest
Forbidden
InternalServerError
NotFound
ServiceUnavailable
TooManyRequests
Unauthorized
UnsupportedMediaType

ErrorResponse

錯誤回應遵循 Microsoft Azure REST API 指導方針,可在 https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors取得。

名稱 類型 Description
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提供。 這包括必要的屬性錯誤碼、訊息和選擇性屬性目標、內部錯誤(這可以是巢狀的)。

名稱 類型 Description
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”。

Model

Model 物件

名稱 類型 Description
consentId

string

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

資源標識碼

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

模型描述

engineVersion

string

引擎版本。 更新此版本可以取得最新的發音錯誤修正。

id

string

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

資源標識碼

lastActionDateTime

string (date-time)

輸入目前狀態時的時間戳。 時間戳會編碼為 ISO 8601 日期和時間格式(“YYYY-MM-DDThh:mm:ssZ”,請參閱 https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)。

locale

string

此模型的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡找到文字到語音轉換的地區設定清單,https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts

projectId

string

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

資源標識碼

properties

ModelProperties

模型屬性

recipe

Recipe

模型建置的配方。 不同的食譜有不同的功能。

status

Status

資源的狀態。

trainingSetId

string

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

資源標識碼

voiceName

string

minLength: 1

語音名稱

ModelFailureReason

模型定型失敗原因

Description
InaccessibleCustomerStorage

客戶會在語音帳戶中使用「攜帶您自己的記憶體」。 但是現在無法存取記憶體。 請檢查

Internal

自訂語音服務錯誤。

SpeakerVerificationFailed

同意和訓練音訊不是來自相同的說話者。

TerminateByUser

客戶已取消模型定型。

ModelProperties

模型屬性

名稱 類型 Description
failureReason

ModelFailureReason

模型定型失敗原因

presetStyles

string[]

此模型的預設樣式。

styleTrainingSetIds

object

自定義樣式和相關聯的定型集。

voiceStyles

string[]

此模型支援的所有樣式。

PresetStyleItem

食譜支援的預設樣式。 語音模型可以支持這些樣式,而不需要任何樣式定型集。

名稱 類型 Description
female

string[]

女性語音模型支援的預設樣式。

male

string[]

男性語音模型支援的預設樣式。

Recipe

模型建置的配方。 不同的食譜有不同的功能。

名稱 類型 Description
datasetLocales

string[]

定型數據集的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡找到文字到語音轉換的地區設定清單,https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts

description

string

配方描述

kind

string

食譜種類

maxCustomStyleNum

integer (int32)

單一語音模型中支援的自定義樣式號碼上限。

minStyleUtteranceCount

integer (int32)

定型每個自定義樣式所需的最小語句計數。

minUtteranceCount

integer (int32)

使用此配方定型語音模型所需的最小語句計數。

modelLocales

string[]

語音模型可以與這個食譜交談的地區設定。 地區設定程式代碼遵循 BCP-47。 您可以在這裡找到文字到語音轉換的地區設定清單,https://learn.microsoft.com/azure/ai-services/speech-service/language-support?tabs=tts

presetStyles

<string,  PresetStyleItem>

此配方每個地區設定支援的預設樣式。 您可以取得這些樣式,而不需要任何樣式定型集。

version

string

配方版本

Status

資源的狀態。

Description
Disabled
Disabling
Failed
NotStarted
Running
Succeeded