共用方式為


快速入門:使用 Azure OpenAI Whisper 模型進行語音轉換文字

在這個快速入門中,你會使用 Azure OpenAI Whisper 模型 進行語音轉文字轉換。 Whisper 模型可以使用多種語言來轉譯人類語音,也可以將其他語言轉譯成英文。

備註

如需您可以搭配 Azure OpenAI 使用之其他音訊模型的資訊,請參閱 音訊模型

Whisper 模型的檔案大小限制為 25 MB。 如果您需要轉譯大於 25 MB 的檔案,您可以使用 Foundry Tools 批次轉譯 API 中的 Azure 語音。

先決條件

設定

擷取金鑰和端點

若要成功對 Azure OpenAI 進行呼叫,您需要端點金鑰

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 檢查來自 Azure 入口網站 的資源時,可以在 [金鑰與端點] 區段中找到服務端點。 或者,你也可以透過 Microsoft Foundry 入口網站的 部署 頁面找到該端點。 範例端點為:https://docs-test-001.openai.azure.com/
AZURE_OPENAI_API_KEY 從 Azure 入口網站查看您的資源時,可以在 [金鑰與端點] 區段中找到此值。 您可以使用 KEY1KEY2

移至您在 Azure 入口網站中的資源。 您可以在 [資源管理] 區段中找到 [端點和金鑰]。 複製您的端點和存取金鑰,因為您需要這兩者才能驗證 API 呼叫。 您可以使用 KEY1KEY2。 隨時持有兩個金鑰可讓您安全地輪替和重新產生金鑰,而不會造成服務中斷。

此螢幕擷取畫面顯示 Azure 入口網站中某個 Azure OpenAI 資源的概觀使用者介面,其中以紅色圓圈顯示端點和存取金鑰位置。

環境變數

為您的金鑰和端點建立及指派永續性環境變數。

這很重要

請謹慎使用 API 金鑰。 請勿在程式碼中直接包含 API 金鑰,且切勿公開張貼金鑰。 如果您使用 API 金鑰,請安全地將其儲存在 Azure 金鑰保存庫。 如需在應用程式中安全地使用 API 金鑰的詳細資訊,請參閱 使用 Azure Key Vault 的 API 金鑰

如需 AI 服務安全性的詳細資訊,請參閱驗證對 Azure AI 服務的要求

setx AZURE_OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE" 
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE" 

建立 REST API 要求和回應

在 bash 終端中,執行下列命令。 您必須將 YourDeploymentName 取代為在部署 Whisper 模型時所選擇的部署名稱。 部署名稱不一定要與模型名稱相同。 輸入模型名稱會導致錯誤,除非您選擇的部署名稱與基礎模型名稱相同。

curl $AZURE_OPENAI_ENDPOINT/openai/deployments/YourDeploymentName/audio/transcriptions?api-version=2024-02-01 \
 -H "api-key: $AZURE_OPENAI_API_KEY" \
 -H "Content-Type: multipart/form-data" \
 -F file="@./wikipediaOcelot.wav"

具有範例端點的先前命令第一行將如下所示:

curl https://aoai-docs.openai.azure.com/openai/deployments/{YourDeploymentName}/audio/transcriptions?api-version=2024-02-01 \

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

這很重要

在生產環境中,請使用安全方式來儲存及存取 Azure Key Vault 等認證。 如需詳細資訊,請參閱 認證安全性

輸出

{"text":"The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, Mexico, and Central and South America. This medium-sized cat is characterized by solid black spots and streaks on its coat, round ears, and white neck and undersides. It weighs between 8 and 15.5 kilograms, 18 and 34 pounds, and reaches 40 to 50 centimeters 16 to 20 inches at the shoulders. It was first described by Carl Linnaeus in 1758. Two subspecies are recognized, L. p. paradalis and L. p. mitis. Typically active during twilight and at night, the ocelot tends to be solitary and territorial. It is efficient at climbing, leaping, and swimming. It preys on small terrestrial mammals such as armadillo, opossum, and lagomorphs."}

先決條件

設定

擷取金鑰和端點

若要成功對 Azure OpenAI 進行呼叫,您需要端點金鑰

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 檢查來自 Azure 入口網站 的資源時,可以在 [金鑰與端點] 區段中找到服務端點。 或者,你也可以透過 Microsoft Foundry 入口網站的 部署 頁面找到該端點。 範例端點為:https://docs-test-001.openai.azure.com/
AZURE_OPENAI_API_KEY 從 Azure 入口網站查看您的資源時,可以在 [金鑰與端點] 區段中找到此值。 您可以使用 KEY1KEY2

移至您在 Azure 入口網站中的資源。 您可以在 [資源管理] 區段中找到 [端點和金鑰]。 複製您的端點和存取金鑰,因為您需要這兩者才能驗證 API 呼叫。 您可以使用 KEY1KEY2。 隨時持有兩個金鑰可讓您安全地輪替和重新產生金鑰,而不會造成服務中斷。

此螢幕擷取畫面顯示 Azure 入口網站中某個 Azure OpenAI 資源的概觀使用者介面,其中以紅色圓圈顯示端點和存取金鑰位置。

環境變數

為您的金鑰和端點建立及指派永續性環境變數。

這很重要

請謹慎使用 API 金鑰。 請勿在程式碼中直接包含 API 金鑰,且切勿公開張貼金鑰。 如果您使用 API 金鑰,請安全地將其儲存在 Azure 金鑰保存庫。 如需在應用程式中安全地使用 API 金鑰的詳細資訊,請參閱 使用 Azure Key Vault 的 API 金鑰

如需 AI 服務安全性的詳細資訊,請參閱驗證對 Azure AI 服務的要求

setx AZURE_OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE" 
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE" 

這很重要

建議使用無密碼認證

針對無密碼驗證,您需要:

  1. 使用 @azure/identity 套件。
  2. Cognitive Services User 角色指派給您的使用者帳戶。 這可以在 Azure 入口網站底下的 [存取控制 (IAM)]> [新增角色指派] 中完成。
  3. 使用 Azure CLI 登入,例如 az login

建立 Python 環境

使用下列項目安裝 OpenAI Python 用戶端程式庫:

pip install openai

建立 Python 應用程式

  1. 建立命名為 quickstart.py 的新 Python 檔案。 然後,以您慣用的編輯器或 IDE 加以開啟。

  2. quickstart.py 的內容取代為下列程式碼。 修改程式碼以新增部署名稱:

    import os
    from openai import AzureOpenAI
        
    client = AzureOpenAI(
        api_key=os.getenv("AZURE_OPENAI_API_KEY"),  
        api_version="2024-02-01",
        azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
    )
    
    deployment_id = "YOUR-DEPLOYMENT-NAME-HERE" #This will correspond to the custom name you chose for your deployment when you deployed a model."
    audio_test_file = "./wikipediaOcelot.wav"
    
    result = client.audio.transcriptions.create(
        file=open(audio_test_file, "rb"),            
        model=deployment_id
    )
    
    print(result)

使用快速入門檔案上的 python 命令來執行應用程式:

python quickstart.py

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

這很重要

在生產環境中,請使用安全方式來儲存及存取 Azure Key Vault 等認證。 如需詳細資訊,請參閱 認證安全性

輸出

{"text":"The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, Mexico, and Central and South America. This medium-sized cat is characterized by solid black spots and streaks on its coat, round ears, and white neck and undersides. It weighs between 8 and 15.5 kilograms, 18 and 34 pounds, and reaches 40 to 50 centimeters 16 to 20 inches at the shoulders. It was first described by Carl Linnaeus in 1758. Two subspecies are recognized, L. p. paradalis and L. p. mitis. Typically active during twilight and at night, the ocelot tends to be solitary and territorial. It is efficient at climbing, leaping, and swimming. It preys on small terrestrial mammals such as armadillo, opossum, and lagomorphs."}

先決條件

Microsoft Entra ID 必要條件

針對具有 Microsoft Entra ID 的建議無金鑰驗證,您需要:

  • 安裝用於無密鑰驗證的 Azure CLI 以進行 Microsoft Entra ID 的認證。
  • Cognitive Services User 角色指派給您的使用者帳戶。 您可以在 Azure 入口網站中,在 [存取控制 (IAM)]> [新增角色指派] 下指派角色。

設定

  1. 建立新的資料夾 whisper-quickstart ,並使用下列命令移至快速入門資料夾:

    mkdir whisper-quickstart && cd whisper-quickstart
    
  2. 使用下列命令建立新的主控台應用程式:

    dotnet new console
    
  3. 使用 dotnet add package 命令安裝 OpenAI .NET 用戶端連結庫:

    dotnet add package Azure.AI.OpenAI
    
  4. 如需使用 Microsoft Entra ID 推薦的無密鑰驗證,請安裝 Azure.Identity 套件:

    dotnet add package Azure.Identity
    
  5. 如需使用 Microsoft Entra ID 的建議 無密鑰驗證,請使用下列命令登入 Azure:

    az login
    

擷取資源資訊

您需要擷取下列資訊,以向 Azure OpenAI 資源驗證您的應用程式:

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 在 Azure 入口網站查看資源時,您可以在 [金鑰和端點] 區段中找到此值。
AZURE_OPENAI_DEPLOYMENT_NAME 此值會對應至您在部署模型時為部署選擇的自訂名稱。 您可以在 Azure 入口網站 中的資源管理找到此值。

深入瞭解 無金鑰驗證設定環境變數

執行快速入門

本快速入門中的範例程式代碼會針對建議的無密鑰驗證使用 Microsoft Entra 識別碼。 如果您想要使用 API 金鑰,可以將 DefaultAzureCredential 物件取代為 AzureKeyCredential 物件。

AzureOpenAIClient openAIClient = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential()); 

備註

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

若要執行快速啟動,請遵循下列步驟:

  1. Program.cs 的內容替換為以下代碼,並將佔位元值更新為您自己的值。

    using Azure;
    using Azure.AI.OpenAI;
    using Azure.Identity; // Required for Passwordless auth
    
    
    string deploymentName = "whisper";
    
    string endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT") ?? "https://<your-resource-name>.openai.azure.com/";
    string key = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY") ?? "<your-key>";
    
    // Use the recommended keyless credential instead of the AzureKeyCredential credential.
    AzureOpenAIClient openAIClient = new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential()); 
    //AzureOpenAIClient openAIClient = new AzureOpenAIClient(new Uri(endpoint), new AzureKeyCredential(key));
    
    var audioFilePath = "<audio file path>"
    
    var audioClient = openAIClient.GetAudioClient(deploymentName);
    
    var result = await audioClient.TranscribeAudioAsync(audioFilePath);
    
    Console.WriteLine("Transcribed text:");
    foreach (var item in result.Value.Text)
    {
        Console.Write(item);
    }
    
  2. 使用 dotnet run Visual Studio 頂端的 命令或執行按鈕執行應用程式:

    dotnet run
    

輸出

如果您使用範例音訊檔案,您應該會在控制台中看到下列文字:

The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, 
Mexico, and Central and South America. This medium-sized cat is characterized by solid 
black spots and streaks on its coat, round ears...

原始程式碼 (英文) | 套件 (npm) (英文) | 範例 (英文)

先決條件

Microsoft Entra ID 必要條件

針對具有 Microsoft Entra ID 的建議無金鑰驗證,您需要:

  • 安裝用於無密鑰驗證的 Azure CLI 以進行 Microsoft Entra ID 的認證。
  • Cognitive Services User 角色指派給您的使用者帳戶。 您可以在 Azure 入口網站中,在 [存取控制 (IAM)]> [新增角色指派] 下指派角色。

設定

  1. 建立新的資料夾 synthesis-quickstart ,並使用下列命令移至快速入門資料夾:

    mkdir synthesis-quickstart && cd synthesis-quickstart
    
  2. 使用下列命令建立 package.json

    npm init -y
    
  3. 使用以下指令安裝適用於 JavaScript 的 OpenAI 客戶端庫:

    npm install openai
    
  4. 若要設定建議的無密碼驗證:

    npm install @azure/identity
    

擷取資源資訊

您需要擷取下列資訊,以向 Azure OpenAI 資源驗證您的應用程式:

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 在 Azure 入口網站查看資源時,您可以在 [金鑰和端點] 區段中找到此值。
AZURE_OPENAI_DEPLOYMENT_NAME 此值會對應至您在部署模型時為部署選擇的自訂名稱。 您可以在 Azure 入口網站 中的資源管理找到此值。

深入瞭解 無金鑰驗證設定環境變數

謹慎

若要搭配 SDK 使用建議的無密鑰驗證,請確定 AZURE_OPENAI_API_KEY 未設定環境變數。

建立應用程式範例

  1. 使用下列程式代碼,建立 index.js 檔案。

    const { createReadStream } = require("fs");
    const { AzureOpenAI } = require("openai");
    const { DefaultAzureCredential, getBearerTokenProvider } = require("@azure/identity");
    
    // You will need to set these environment variables or edit the following values
    const audioFilePath = "<audio file path>";
    const endpoint = process.env.AZURE_OPENAI_ENDPOINT || "Your endpoint";
    
    // Required Azure OpenAI deployment name and API version
    const apiVersion = process.env.OPENAI_API_VERSION || "2024-08-01-preview";
    const deploymentName = process.env.AZURE_OPENAI_DEPLOYMENT_NAME || "whisper";
    
    // keyless authentication    
    const credential = new DefaultAzureCredential();
    const scope = "https://cognitiveservices.azure.com/.default";
    const azureADTokenProvider = getBearerTokenProvider(credential, scope);
    
    function getClient() {
      return new AzureOpenAI({
        endpoint,
        azureADTokenProvider,
        apiVersion,
        deployment: deploymentName,
      });
    }
    
    export async function main() {
      console.log("== Transcribe Audio Sample ==");
    
      const client = getClient();
      const result = await client.audio.transcriptions.create({
        model: "",
        file: createReadStream(audioFilePath),
      });
    
      console.log(`Transcription: ${result.text}`);
    }
    
    main().catch((err) => {
      console.error("The sample encountered an error:", err);
    });
    
  2. 使用下列命令登入 Azure:

    az login
    
  3. 執行 JavaScript 檔案。

    node index.js
    

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

輸出

{"text":"The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, Mexico, and Central and South America. This medium-sized cat is characterized by solid black spots and streaks on its coat, round ears, and white neck and undersides. It weighs between 8 and 15.5 kilograms, 18 and 34 pounds, and reaches 40 to 50 centimeters 16 to 20 inches at the shoulders. It was first described by Carl Linnaeus in 1758. Two subspecies are recognized, L. p. paradalis and L. p. mitis. Typically active during twilight and at night, the ocelot tends to be solitary and territorial. It is efficient at climbing, leaping, and swimming. It preys on small terrestrial mammals such as armadillo, opossum, and lagomorphs."}

原始程式碼 (英文) | 套件 (npm) (英文) | 範例 (英文)

先決條件

Microsoft Entra ID 必要條件

針對具有 Microsoft Entra ID 的建議無金鑰驗證,您需要:

  • 安裝用於無密鑰驗證的 Azure CLI 以進行 Microsoft Entra ID 的認證。
  • Cognitive Services User 角色指派給您的使用者帳戶。 您可以在 Azure 入口網站中,在 [存取控制 (IAM)]> [新增角色指派] 下指派角色。

設定

  1. 建立新的資料夾 whisper-quickstart ,並使用下列命令移至快速入門資料夾:

    mkdir whisper-quickstart && cd whisper-quickstart
    
  2. 使用下列命令建立 package.json

    npm init -y
    
  3. 請使用下列命令將 package.json 更新為 ECMAScript。

    npm pkg set type=module
    
  4. 使用以下指令安裝適用於 JavaScript 的 OpenAI 客戶端庫:

    npm install openai
    
  5. 若要設定建議的無密碼驗證:

    npm install @azure/identity
    

擷取資源資訊

您需要擷取下列資訊,以向 Azure OpenAI 資源驗證您的應用程式:

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 在 Azure 入口網站查看資源時,您可以在 [金鑰和端點] 區段中找到此值。
AZURE_OPENAI_DEPLOYMENT_NAME 此值會對應至您在部署模型時為部署選擇的自訂名稱。 您可以在 Azure 入口網站 中的資源管理找到此值。

深入瞭解 無金鑰驗證設定環境變數

謹慎

若要搭配 SDK 使用建議的無密鑰驗證,請確定 AZURE_OPENAI_API_KEY 未設定環境變數。

建立應用程式範例

  1. 使用下列程式代碼,建立 index.ts 檔案。

    import { createReadStream } from "fs";
    import { AzureOpenAI } from "openai";
    import { DefaultAzureCredential, getBearerTokenProvider } from "@azure/identity";
    
    // You will need to set these environment variables or edit the following values
    const audioFilePath = "<audio file path>";
    const endpoint = process.env.AZURE_OPENAI_ENDPOINT || "Your endpoint";
    
    // Required Azure OpenAI deployment name and API version
    const apiVersion = process.env.OPENAI_API_VERSION || "2024-08-01-preview";
    const deploymentName = process.env.AZURE_OPENAI_DEPLOYMENT_NAME || "whisper";
    
    // keyless authentication    
    const credential = new DefaultAzureCredential();
    const scope = "https://cognitiveservices.azure.com/.default";
    const azureADTokenProvider = getBearerTokenProvider(credential, scope);
    
    function getClient(): AzureOpenAI {
      return new AzureOpenAI({
        endpoint,
        azureADTokenProvider,
        apiVersion,
        deployment: deploymentName,
      });
    }
    
    export async function main() {
      console.log("== Transcribe Audio Sample ==");
    
      const client = getClient();
      const result = await client.audio.transcriptions.create({
        model: "",
        file: createReadStream(audioFilePath),
      });
    
      console.log(`Transcription: ${result.text}`);
    }
    
    main().catch((err) => {
      console.error("The sample encountered an error:", err);
    });
    
  2. 建立檔案 tsconfig.json 以轉譯 TypeScript 程式代碼,並複製 ECMAScript 的下列程式代碼。

    {
        "compilerOptions": {
          "module": "NodeNext",
          "target": "ES2022", // Supports top-level await
          "moduleResolution": "NodeNext",
          "skipLibCheck": true, // Avoid type errors from node_modules
          "strict": true // Enable strict type-checking options
        },
        "include": ["*.ts"]
    }
    
  3. 從 TypeScript 轉譯為 JavaScript。

    tsc
    
  4. 使用下列命令登入 Azure:

    az login
    
  5. 使用下列命令執行程式碼:

    node index.js
    

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

這很重要

請謹慎使用 API 金鑰。 請勿在程式碼中直接包含 API 金鑰,且切勿公開張貼金鑰。 如果您使用 API 金鑰,請安全地將其儲存在 Azure 金鑰保存庫。 如需在應用程式中安全地使用 API 金鑰的詳細資訊,請參閱 使用 Azure Key Vault 的 API 金鑰

如需 AI 服務安全性的詳細資訊,請參閱驗證對 Azure AI 服務的要求

輸出

{"text":"The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, Mexico, and Central and South America. This medium-sized cat is characterized by solid black spots and streaks on its coat, round ears, and white neck and undersides. It weighs between 8 and 15.5 kilograms, 18 and 34 pounds, and reaches 40 to 50 centimeters 16 to 20 inches at the shoulders. It was first described by Carl Linnaeus in 1758. Two subspecies are recognized, L. p. paradalis and L. p. mitis. Typically active during twilight and at night, the ocelot tends to be solitary and territorial. It is efficient at climbing, leaping, and swimming. It preys on small terrestrial mammals such as armadillo, opossum, and lagomorphs."}

先決條件

設定

擷取金鑰和端點

若要成功對 Azure OpenAI 進行呼叫,您需要端點金鑰

變數名稱 價值觀
AZURE_OPENAI_ENDPOINT 檢查來自 Azure 入口網站 的資源時,可以在 [金鑰與端點] 區段中找到服務端點。 或者,你也可以透過 Microsoft Foundry 入口網站的 部署 頁面找到該端點。 範例端點為:https://docs-test-001.openai.azure.com/
AZURE_OPENAI_API_KEY 從 Azure 入口網站查看您的資源時,可以在 [金鑰與端點] 區段中找到此值。 您可以使用 KEY1KEY2

移至您在 Azure 入口網站中的資源。 您可以在 [資源管理] 區段中找到 [端點和金鑰]。 複製您的端點和存取金鑰,因為您需要這兩者才能驗證 API 呼叫。 您可以使用 KEY1KEY2。 隨時持有兩個金鑰可讓您安全地輪替和重新產生金鑰,而不會造成服務中斷。

此螢幕擷取畫面顯示 Azure 入口網站中某個 Azure OpenAI 資源的概觀使用者介面,其中以紅色圓圈顯示端點和存取金鑰位置。

環境變數

為您的金鑰和端點建立及指派永續性環境變數。

這很重要

請謹慎使用 API 金鑰。 請勿在程式碼中直接包含 API 金鑰,且切勿公開張貼金鑰。 如果您使用 API 金鑰,請安全地將其儲存在 Azure 金鑰保存庫。 如需在應用程式中安全地使用 API 金鑰的詳細資訊,請參閱 使用 Azure Key Vault 的 API 金鑰

如需 AI 服務安全性的詳細資訊,請參閱驗證對 Azure AI 服務的要求

setx AZURE_OPENAI_API_KEY "REPLACE_WITH_YOUR_KEY_VALUE_HERE" 
setx AZURE_OPENAI_ENDPOINT "REPLACE_WITH_YOUR_ENDPOINT_HERE" 

建立 PowerShell 應用程式

執行下列命令。 您必須將 YourDeploymentName 取代為在部署 Whisper 模型時所選擇的部署名稱。 部署名稱不一定要與模型名稱相同。 除非您選擇與基礎模型名稱相同的部署名稱,否則輸入模型名稱會導致錯誤。

# Azure OpenAI metadata variables
$openai = @{
    api_key     = $Env:AZURE_OPENAI_API_KEY
    api_base    = $Env:AZURE_OPENAI_ENDPOINT # your endpoint should look like the following https://YOUR_RESOURCE_NAME.openai.azure.com/
    api_version = '2024-02-01' # this may change in the future
    name        = 'YourDeploymentName' #This will correspond to the custom name you chose for your deployment when you deployed a model.
}

# Header for authentication
$headers = [ordered]@{
    'api-key' = $openai.api_key
}

$form = @{ file = get-item -path './wikipediaOcelot.wav' }

# Send a completion call to generate an answer
$url = "$($openai.api_base)/openai/deployments/$($openai.name)/audio/transcriptions?api-version=$($openai.api_version)"

$response = Invoke-RestMethod -Uri $url -Headers $headers -Form $form -Method Post -ContentType 'multipart/form-data'
return $response.text

您可以從 GitHub 的 Foundry Tools SDK 存放庫中的 Azure 語音取得範例音訊檔案,例如 wikipediaOcelot.wav

這很重要

在生產環境中,請使用安全方法 (例如使用 Azure Key Vault 進行 PowerShell 秘密管理) 來儲存及存取認證。 如需詳細資訊,請參閱 認證安全性

輸出

The ocelot, Lepardus paradalis, is a small wild cat native to the southwestern United States, Mexico, and Central and South America. This medium-sized cat is characterized by solid black spots and streaks on its coat, round ears, and white neck and undersides. It weighs between 8 and 15.5 kilograms, 18 and 34 pounds, and reaches 40 to 50 centimeters 16 to 20 inches at the shoulders. It was first described by Carl Linnaeus in 1758. Two subspecies are recognized, L. p. paradalis and L. p. mitis. Typically active during twilight and at night, the ocelot tends to be solitary and territorial. It is efficient at climbing, leaping, and swimming. It preys on small terrestrial mammals such as armadillo, opossum, and lagomorphs.

清理資源

如果您想要清除和移除 Azure OpenAI 資源,可以刪除資源。 刪除資源之前,您必須先刪除任何已部署的模型。

後續步驟