Text Independent - Create Enrollment
註冊配置檔
將註冊新增至現有的配置檔。
第一個註冊必須是預先定義的啟用片語,可以使用 /phrases/{locale} api 列出。
如果達到要求的註冊音訊數目下限,則會建立語音列印。
任何進一步的註冊都會用來改善語音列印。
限制:
每個要求的音訊輸入長度下限為 1秒
每個要求的音訊輸入長度上限為 120秒
最小有效語音長度 (排除無聲和其他非語音畫面) 建立語音列印的最小有效語音長度為 20 秒 。您可以將 ignoreMinLength 設定為 true 來停用這項限制。
建立語音列印所允許的最大音訊輸入長度上限為 300秒
(SNR) 的最小音訊號與雜訊比率為 2dB
POST {endpoint}/speaker-recognition/identification/text-independent/profiles/{profileId}/enrollments?api-version=2021-09-05
POST {endpoint}/speaker-recognition/identification/text-independent/profiles/{profileId}/enrollments?api-version=2021-09-05&ignoreMinLength={ignoreMinLength}
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
endpoint
|
path | True |
string |
支援的認知服務端點 (通訊協定和主機名,例如: https://westus.api.cognitive.microsoft.com) 。 |
profile
|
path | True |
string uuid |
配置文件標識碼的唯一標識碼 (guid) 。 |
api-version
|
query | True |
string |
指定用於這個要求的作業版本。 |
ignore
|
query |
boolean |
如果為 true,則不論提供或儲存多少語音,都會立即為此配置檔建立語音列印。 預設值為 false。 |
要求標頭
Media Types: "audio/wav; codecs=audio/pcm"
名稱 | 必要 | 類型 | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
要求本文
Media Types: "audio/wav; codecs=audio/pcm"
名稱 | 類型 | Description |
---|---|---|
audioData |
object |
二進位音訊檔案。 支援的格式為音訊/wav;codecs=audio/pcm。 支援最多 5 MB 的音訊。 |
回應
名稱 | 類型 | Description |
---|---|---|
201 Created |
建立時間 |
|
Other Status Codes |
失敗 Headers x-ms-error-code: string |
安全性
Ocp-Apim-Subscription-Key
Type:
apiKey
In:
header
範例
Successful Query
Sample Request
POST https://westus.api.cognitive.microsoft.com/speaker-recognition/identification/text-independent/profiles/49a36324-fc4b-4387-aa06-090cfbf0064f/enrollments?api-version=2021-09-05
"{binary file date}"
Sample Response
Content-Type: application/json
{
"profileId": "49a36324-fc4b-4387-aa06-090cfbf0064f",
"enrollmentStatus": "Enrolling",
"enrollmentsCount": 1,
"enrollmentsLengthInSec": 1.83,
"enrollmentsSpeechLengthInSec": 1.35,
"remainingEnrollmentsSpeechLengthInSec": 18.65,
"audioLengthInSec": 1.83,
"audioSpeechLengthInSec": 1.35
}
Content-Type: application/json
x-ms-error-code: Error Code
{
"error": {
"code": "Error Code",
"message": "Erro Messae"
}
}
定義
名稱 | Description |
---|---|
Error | |
Speaker |
說話者錯誤訊息 |
Ti |
說話者配置檔註冊資訊 |
Training |
狀態,表示配置檔註冊的目前狀態。 可用值為:
|
Error
名稱 | 類型 | Description |
---|---|---|
code |
string |
|
message |
string |
SpeakerErrorInfo
說話者錯誤訊息
名稱 | 類型 | Description |
---|---|---|
error |
TiEnrollmentInfo
說話者配置檔註冊資訊
名稱 | 類型 | Description |
---|---|---|
audioLengthInSec |
number |
此註冊音訊長度以秒為單位。 |
audioSpeechLengthInSec |
number |
此註冊音訊純語音 (,這是移除無聲和非語音區段後音訊量,以秒為單位) 長度。 |
enrollmentStatus |
狀態,表示配置檔註冊的目前狀態。 可用值為:
|
|
enrollmentsCount |
integer |
此設定檔接受的註冊音訊數目。 |
enrollmentsLengthInSec |
number |
此配置檔接受的註冊音訊總長度,以秒為單位。 |
enrollmentsSpeechLengthInSec |
number |
純語音 (的總和,這是移除無聲和非語音區段之後,) 在幾秒內所有配置檔註冊后的音頻數量。 |
profileId |
string |
配置文件標識碼的唯一標識碼 (guid) 。 |
remainingEnrollmentsSpeechLengthInSec |
number |
純語音 (,這是移除無聲和非語音區段之後音訊數量,) 數秒內完成配置檔註冊所需的數量。 |
TrainingStatusType
狀態,表示配置檔註冊的目前狀態。 可用值為:
- 註冊:配置文件沒有語音列印,且尚未準備好進行辨識要求。
- 訓練:正在建立配置文件的語音列印,目前無法用於辨識。
- 已註冊:配置檔具有語音列印,並準備好進行辨識要求。
名稱 | 類型 | Description |
---|---|---|
Enrolled |
string |
|
Enrolling |
string |
|
Training |
string |