Transcriptions - Transcribe
轉譯提供的音訊數據流。
POST {endpoint}/speechtotext/transcriptions:transcribe?api-version=2024-05-15-preview
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
audio
|
formData | True |
file binary |
音訊做為位元組數據流。 |
definition
|
formData | True |
string |
快速轉譯要求的元數據。 此欄位包含類型為 |
endpoint
|
path | True |
string |
支援的認知服務端點(通訊協定和主機名,例如:https://westus.api.cognitive.microsoft.com)。 |
api-version
|
query | True |
string |
要求的 API 版本。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
還行 |
安全性
Ocp-Apim-Subscription-Key
在這裡提供您的認知服務帳戶金鑰。
類型:
apiKey
位於:
header
Authorization
提供來自此區域 STS 所傳回之 JWT 的存取令牌。 請務必將下列查詢字串新增至 STS URL,將管理範圍新增至令牌:?scope=speechservicesmanagement
類型:
apiKey
位於:
header
範例
Transcribe an audio file
範例要求
POST {endpoint}/speechtotext/transcriptions:transcribe?api-version=2024-05-15-preview
範例回覆
{
"duration": 2000,
"combinedPhrases": [
{
"text": "Weather"
}
],
"phrases": [
{
"offset": 40,
"duration": 240,
"text": "Weather",
"words": [
{
"text": "Weather",
"offset": 40,
"duration": 240
}
],
"locale": "en-US",
"confidence": 0.7881154
}
]
}
定義
名稱 | Description |
---|---|
Combined |
|
Phrase |
已轉譯的片語。 |
Transcribe |
轉譯作業的結果。 |
Word |
顯示表單的時間戳字組。 |
CombinedPhrases
名稱 | 類型 | Description |
---|---|---|
channel |
integer |
以 0 為基礎的通道索引。 只有在啟用通道分離時才存在。 |
text |
string |
通道的完整轉譯文字。 |
Phrase
已轉譯的片語。
名稱 | 類型 | Description |
---|---|---|
channel |
integer |
以 0 為基礎的通道索引。 只有在啟用通道分離時才存在。 |
confidence |
number |
片語的信賴值。 |
duration |
integer |
以毫秒為單位的片語持續時間。 |
locale |
string |
片語的地區設定。 |
offset |
integer |
片語的開始位移以毫秒為單位。 |
speaker |
integer |
說話者號碼。 只有在已啟用說話者聽寫時,才會存在。 |
text |
string |
片語的轉譯文字。 |
words |
Word[] |
構成片語的字組。 只有在啟用文字層級時間戳時,才會存在。 |
TranscribeResult
轉譯作業的結果。
名稱 | 類型 | Description |
---|---|---|
combinedPhrases |
每個通道的合併轉譯結果。 |
|
duration |
integer |
以毫秒為單位的音訊持續時間。 |
phrases |
Phrase[] |
謄寫結果分成詞組。 |
Word
顯示表單的時間戳字組。
名稱 | 類型 | Description |
---|---|---|
duration |
integer |
以毫秒為單位的字組持續時間。 |
offset |
integer |
以毫秒為單位的字組開始位移。 |
text |
string |
可辨識的字組,包括標點符號。 |