開始使用免費開始

轉錄非英文語音

OpenAI 的音訊模型不只可以轉錄英語語音,在多種其他語言的語音上也有不錯的表現。

在這個練習中,你將從 audio.m4a 建立逐字稿,該檔案包含葡萄牙語的語音。

本練習屬於課程

使用 OpenAI API 的多模態系統

檢視課程

練習說明

  • read-binary 模式開啟 audio.m4a 檔案。
  • 向 Audio 端點建立一次轉錄請求。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

client = OpenAI(api_key="")

# Open the audio.m4a file
audio_file = ____("____", "____")

# Create a transcript from the audio file
response = client.audio.transcriptions.____(model="whisper-1", file=____)

print(response.text)
編輯並執行程式碼