Files
SnapOtter/apps/docs/zh-TW/tools/audio/transcribe-audio.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

2.0 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
以 AI 驅動的轉錄將語音轉換為文字。 ae98c4c0aed2 human 4fd436ff8a68

語音轉錄

使用 AI 驅動的轉錄(faster-whisper)將語音轉換為文字。支援純文字、SRT 與 VTT 輸出格式,並可自動或手動選擇語言。

API Endpoint

POST /api/v1/tools/audio/transcribe-audio

接受包含一個音訊檔案以及一個 JSON settings 欄位的 multipart form data。

Parameters

Parameter Type Required Default Description
language string No "auto" 語言:autoendefreszhjakoidthvi
outputFormat string No "txt" 輸出格式:txtsrtvtt

Example Request

curl -X POST http://localhost:1349/api/v1/tools/audio/transcribe-audio \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@audio.mp3" \
  -F 'settings={"language": "en", "outputFormat": "srt"}'

Example Response

這是一個非同步工具。API 會立即回傳 202 Accepted

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "async": true
}

透過 GET /api/v1/jobs/{jobId}/progress 的 SSE 追蹤進度。當工作完成時,SSE 串流會傳遞包含 downloadUrl 的最終結果。

Notes

  • 需要安裝 transcription 功能套件包。若套件包無法使用,會回傳 501 並帶有代碼 FEATURE_NOT_INSTALLED、缺少的 featurefeatureName 以及 estimatedSize
  • 使用 faster-whisper 進行轉錄。語言 auto 會自動偵測所說的語言。
  • srtvtt 格式會為每個片段包含時間戳記,適合作為字幕。
  • txt 格式會回傳不含時間戳記的純文字。
  • 這是一個長時間執行的 AI 工具;處理時間取決於音訊長度與伺服器硬體。