

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 入門 Amazon Transcribe
<a name="getting-started"></a>

建立轉錄前，您必須符合下列幾項先決條件：
+ [註冊 AWS 帳戶](#getting-started-sign-up)
+ [安裝 AWS CLI 和 SDKs](#getting-started-api) （如果您使用 AWS 管理主控台 進行轉錄，可以略過此步驟）
+ [配置 IAM 憑證](#getting-started-iam)
+ [設定 Amazon S3 儲存貯體](#getting-started-s3)
+ [建立 IAM 政策](#getting-started-policy)

完成這些先決條件後，您即可進行轉錄。從以下清單中選擇您偏好的轉錄方法以開始使用。
+ [AWS CLI](getting-started-cli.md)
+ [AWS 管理主控台](getting-started-console.md)
+ [AWS 開發套件](getting-started-sdk.md)
+ [HTTP](getting-started-http-websocket.md)
+ [WebSockets](getting-started-http-websocket.md)

**提示**  
如果您是初次使用 Amazon Transcribe 或想要探索我們的功能，建議您使用 [AWS 管理主控台](https://console.aws.amazon.com/transcribe)。如果您想使用電腦麥克風開始串流，這也是最簡單的選擇。

由於使用 HTTP/2 和 WebSockets 進行串流比其他轉錄方法複雜，因此建議您在開始使用這些方法前，參考 [設定串流轉錄](streaming-setting-up.md) 本節。**請注意，我們強烈建議您使用 SDK 進行串流轉錄。**

## 註冊 AWS 帳戶
<a name="getting-started-sign-up"></a>

您可以註冊[免費方案](https://aws.amazon.com/free/)帳戶或[付費帳戶](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html)。這兩個選項都可讓您存取所有 AWS 服務。免費方案有試用期，在此期間您可以探索 AWS 服務 和估計您的用量。試用期到期後，您可以轉移到付費帳戶。費用是按用量付費計算；請參閱 [Amazon Transcribe 定價](https://aws.amazon.com/transcribe/pricing/)，了解詳細資訊。

**提示**  
設定您的帳戶時，請記下您的 AWS 帳戶 ID，因為您需要它來建立 IAM 實體。

## 安裝 AWS CLI 和 SDKs
<a name="getting-started-api"></a>

若要使用 Amazon Transcribe API，您必須先安裝 AWS CLI。目前 AWS CLI 版本是 2。您可以在[AWS Command Line Interface 《使用者指南》**](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)中找到 [Linux](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html)、[Mac](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html)、[Windows](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html) 和 [Docker](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-docker.html) 的安裝說明。

安裝 之後 AWS CLI ，您必須針對安全登入資料和 進行[設定](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) AWS 區域。

如果您想要 Amazon Transcribe 搭配 SDK 使用 ，請選取您偏好的語言以取得安裝指示：
+ [.NET](https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/quick-start.html)
+ [C\+\+](https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/getting-started.html)
+ [Go](https://aws.github.io/aws-sdk-go-v2/docs/)
+ [Java V2](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/setup.html)
+ [JavaScript](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/getting-started.html)
+ [PHP V3](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/getting-started_installation.html)
+ [適用於 Python (Boto3) 的 AWS SDK](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html)(批次轉錄)
+ [Python](https://github.com/awslabs/amazon-transcribe-streaming-sdk)(串流轉錄)
+ [Ruby V3](https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-install.html)
+ [Rust](https://crates.io/crates/aws-sdk-transcribe)(批量轉錄)
+ [Rust](https://crates.io/crates/aws-sdk-transcribestreaming)(串流轉錄)

## 設定 IAM 登入資料
<a name="getting-started-iam"></a>

當您建立 時 AWS 帳戶，您會從一個登入身分開始，該身分可完整存取您帳戶中的所有 AWS 服務和資源。此身分稱為 AWS 帳戶 根使用者，可透過使用您用來建立帳戶的電子郵件地址和密碼登入來存取。

強烈建議您不要以根使用者處理日常作業。保護您的根使用者憑證，並將其用來執行只能由根使用者執行的任務。

根據最佳實務， 要求使用者 - 包括需要管理員存取權的使用者 - 使用聯合身分提供者來使用臨時憑證來存取 AWS 服務。

聯合身分是指使用透過身分來源提供的登入資料存取 AWS 服務的任何使用者。聯合身分存取 AWS 帳戶時，會擔任角色，並由角色提供臨時憑證。

對於集中式存取權管理，我們建議您使用 [AWS IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)。您可以在 IAM Identity Center中建立使用者和群組。或者，您可以連接並同步到您自己的身分來源中的一組使用者和群組，以用於所有 AWS 帳戶 和 應用程式。如需詳細資訊，請參閱[的 Identity and Access Management Amazon Transcribe](security-iam.md)。

若要進一步了解 IAM 最佳實務，請參閱 [中的安全最佳實務 IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)。

## 建立 儲存 Amazon S3 貯體
<a name="getting-started-s3"></a>

Amazon S3 是一種安全的物件儲存服務。 會將您的檔案 （稱為*物件*) Amazon S3 存放在容器 （稱為*儲存貯*體） 中。

若要執行批次轉錄，您必須先將媒體檔案上傳至 儲存 Amazon S3 貯體。如果您未為轉錄輸出指定 儲存 Amazon S3 貯體， 會將您的轉錄 Amazon Transcribe 放入暫時 AWS管理的儲存 Amazon S3 貯體。90 天後會自動刪除受 AWS管儲存貯體中的轉錄輸出。

了解如何[建立您的第一個 S3 儲存貯體](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html)，並[將物件上傳到儲存貯體](https://docs.aws.amazon.com/AmazonS3/latest/userguide/uploading-an-object-bucket.html)。

## 建立 IAM 政策
<a name="getting-started-policy"></a>

若要管理 中的存取 AWS，您必須建立政策，並將其連接到 IAM 身分 （使用者、群組或角色） 或 AWS 資源。政策會定義其所連接之實體的權限。例如，如果您已將政策連接至授予其存取權的該角色，則角色只能存取位於儲存 Amazon S3 貯體中的媒體檔案。如果您想要進一步限制該角色，您可以改為限制其對 Amazon S3 儲存貯體中特定檔案的存取。

若要進一步了解如何使用 AWS 政策，請參閱：
+ [中的政策和許可 IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
+ [建立 IAM 政策](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)
+ [Amazon Transcribe 如何使用 IAM](security_iam_service-with-iam.md)

如需可與 搭配使用的政策範例 Amazon Transcribe，請參閱 [Amazon Transcribe 身分型政策範例](security_iam_id-based-policy-examples.md)。如果您要產生自訂政策，請考慮使用[AWS 政策產生器](https://awspolicygen.s3.amazonaws.com/policygen.html)。

您可以使用 AWS 管理主控台 AWS CLI或 AWS SDK 新增政策。如需說明，請參閱[新增和移除 IAM 身分許可](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html#add-policy-api)。

政策的格式如下：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "{{my-policy-name}}",
            "Effect": "Allow",
            "Action": [
                "{{service}}:{{action}}"
            ],
            "Resource": [
                "{{amazon-resource-name}}"
            ]
        }
    ]
}
```

------

Amazon Resource Name (ARNs可唯一識別所有 AWS 資源，例如 儲存 Amazon S3 貯體。您可以在政策中使用 ARN 以授與使用特定資源的特定動作的權限。例如，如果您想要授予 儲存 Amazon S3 貯體及其子資料夾的讀取存取權，您可以將下列程式碼新增至信任政策的 `Statement`區段：

```
{
        "Effect": "Allow",
        "Action": [
            "s3:GetObject",
            "s3:ListBucket"
        ],
        "Resource": [
            "arn:aws:s3:::{{amzn-s3-demo-bucket}}",
            "arn:aws:s3:::{{amzn-s3-demo-bucket/*}}"
        ]
}
```

以下是將 Amazon Transcribe 讀取 (`GetObject`、`ListBucket`) 和寫入 (`PutObject`) 許可授予 儲存 Amazon S3 貯體`amzn-s3-demo-bucket`、 及其子資料夾的範例政策：

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::{{amzn-s3-demo-bucket}}",
                "arn:aws:s3:::{{amzn-s3-demo-bucket/*}}"
            ]
        },
        {
             "Effect": "Allow",
             "Action": [
                 "s3:PutObject"
             ],
             "Resource": [
                 "arn:aws:s3:::{{amzn-s3-demo-bucket}}",
                 "arn:aws:s3:::{{amzn-s3-demo-bucket/*}}"
             ]
        }
  ]
}
```

------