

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

# Mentranskripsikan audio multi-saluran
<a name="channel-id"></a>

Jika audio Anda memiliki dua saluran, Anda dapat menggunakan identifikasi saluran untuk mentranskripsikan ucapan dari setiap saluran secara terpisah. Amazon TranscribeSaat ini tidak mendukung audio dengan lebih dari dua saluran.

Dalam transkrip Anda, saluran diberi label `ch_0` dan`ch_1`.

Selain [bagian transkrip standar](how-input.md#how-it-works-output) (`transcripts`dan`items`), permintaan dengan identifikasi saluran diaktifkan termasuk `channel_labels` bagian. Bagian ini berisi setiap ucapan atau tanda baca, dikelompokkan berdasarkan saluran, dan label saluran terkait, cap waktu, dan skor kepercayaan.

```
"channel_labels": {
    "channels": [
        {
            "channel_label": "ch_0",
            "items": [                                      
                {
                    "channel_label": "ch_0",
                    "start_time": "4.86",
                    "end_time": "5.01",
                    "alternatives": [
                        {
                            "confidence": "1.0",
                            "content": "I've"
                        }
                    ],
                    "type": "pronunciation"
                },
                ...               
            "channel_label": "ch_1",
            "items": [
                {
                    "channel_label": "ch_1",
                    "start_time": "8.5",
                    "end_time": "8.89",
                    "alternatives": [
                        {
                            "confidence": "1.0",
                            "content": "Sorry"
                        }
                    ],
                    "type": "pronunciation"
                },
                ...
            "number_of_channels": 2
        },
```

Perhatikan bahwa jika seseorang di satu saluran berbicara pada waktu yang sama dengan orang di saluran terpisah, stempel waktu untuk setiap saluran tumpang tindih saat individu berbicara satu sama lain.

Untuk melihat contoh transkrip lengkap dengan identifikasi saluran, lihat[Contoh keluaran identifikasi saluran (batch)](channel-id-output-batch.md).

## Menggunakan identifikasi saluran dalam transkripsi batch
<a name="channel-id-batch"></a>

Untuk mengidentifikasi saluran dalam transkripsi batch, Anda dapat menggunakan **Konsol Manajemen AWS**, **AWS CLI**, atau **AWSSDKs**; lihat contoh berikut:

### Konsol Manajemen AWS
<a name="channel-id-console-batch"></a>

1. Masuk ke [Konsol Manajemen AWS](https://console.aws.amazon.com/transcribe/).

1. Di panel navigasi, pilih **Pekerjaan transkripsi**, lalu pilih **Buat pekerjaan** (kanan atas). Ini membuka halaman **Tentukan detail pekerjaan**.  
![\[Amazon Transcribekonsol 'Tentukan detail pekerjaan' halaman. Di panel 'Pengaturan pekerjaan', Anda dapat menentukan nama untuk pekerjaan transkripsi Anda, memilih jenis Model, dan menentukan pengaturan bahasa Anda.\]](http://docs.aws.amazon.com/id_id/transcribe/latest/dg/images/console-batch-job-details-1.png)

1. Isi kolom yang ingin Anda sertakan di halaman **Tentukan detail pekerjaan**, lalu pilih **Berikutnya**. Ini membawa Anda ke halaman **Konfigurasi pekerjaan - *opsional***.

   Di panel **Pengaturan audio**, pilih **Identifikasi saluran** (di bawah judul 'Jenis identifikasi audio').  
![\[Amazon Transcribekonsol 'Konfigurasikan pekerjaan' halaman. Di panel 'Pengaturan audio', Anda dapat mengaktifkan identifikasi Saluran.\]](http://docs.aws.amazon.com/id_id/transcribe/latest/dg/images/channel-id-batch.png)

1. Pilih **Buat pekerjaan** untuk menjalankan pekerjaan transkripsi Anda. 

### AWS CLI
<a name="channel-id-cli"></a>

Contoh ini menggunakan [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html). Untuk informasi selengkapnya, lihat [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html).

```
aws transcribe start-transcription-job \
--region us-west-2 \
--transcription-job-name my-first-transcription-job \
--media MediaFileUri=s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac \
--output-bucket-name amzn-s3-demo-bucket \
--output-key my-output-files/ \
--language-code en-US \
--settings ChannelIdentification=true
```

Berikut contoh lain menggunakan [start-transcription-job](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/start-transcription-job.html)perintah, dan badan permintaan yang memungkinkan identifikasi saluran dengan pekerjaan itu.

```
aws transcribe start-transcription-job \
--region us-west-2 \
--cli-input-json file://my-first-transcription-job.json
```

File *my-first-transcription-job.json* berisi badan permintaan berikut.

```
{
    "TranscriptionJobName": "my-first-transcription-job",
    "Media": {
        "MediaFileUri": "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
  },
    "OutputBucketName": "amzn-s3-demo-bucket",
    "OutputKey": "my-output-files/", 
    "LanguageCode": "en-US",
    "Settings": {
        "ChannelIdentification": true
    }
}
```

### AWS SDK untuk Python (Boto3)
<a name="channel-id-python-batch"></a>

Contoh ini menggunakan AWS SDK untuk Python (Boto3) untuk mengidentifikasi saluran menggunakan metode [start\$1transcription\$1job](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.start_transcription_job). Untuk informasi selengkapnya, lihat [StartTranscriptionJob](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_StartTranscriptionJob.html).

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
job_name = "my-first-transcription-job"
job_uri = "s3://amzn-s3-demo-bucket/my-input-files/my-media-file.flac"
transcribe.start_transcription_job(
    TranscriptionJobName = job_name,
    Media = {
        'MediaFileUri': job_uri
    },
    OutputBucketName = 'amzn-s3-demo-bucket',
    OutputKey = 'my-output-files/', 
    LanguageCode = 'en-US', 
    Settings = {
        'ChannelIdentification':True
    }
)

while True:
    status = transcribe.get_transcription_job(TranscriptionJobName = job_name)
    if status['TranscriptionJob']['TranscriptionJobStatus'] in ['COMPLETED', 'FAILED']:
        break
    print("Not ready yet...")
    time.sleep(5)
print(status)
```

## Menggunakan identifikasi saluran dalam transkripsi streaming
<a name="channel-id-stream"></a>

Untuk mengidentifikasi saluran dalam transkripsi streaming, Anda dapat menggunakan **HTTP/2** atau **WebSockets**; lihat contoh berikut:

### Aliran HTTP/2
<a name="channel-id-http2"></a>

Contoh ini membuat permintaan HTTP/2 yang memisahkan saluran dalam keluaran transkripsi Anda. Untuk informasi lebih lanjut tentang menggunakan streaming HTTP/2 denganAmazon Transcribe, lihat. [Menyiapkan aliran HTTP/2](streaming-setting-up.md#streaming-http2) Untuk detail selengkapnya tentang parameter dan header khusus untukAmazon Transcribe, lihat [StartStreamTranscription](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html).

```
POST /stream-transcription HTTP/2
host: transcribestreaming.us-west-2.amazonaws.com
X-Amz-Target: com.amazonaws.transcribe.Transcribe.StartStreamTranscription
Content-Type: application/vnd.amazon.eventstream
X-Amz-Content-Sha256: string
X-Amz-Date: 20220208T235959Z
Authorization: AWS4-HMAC-SHA256 Credential=access-key/20220208/us-west-2/transcribe/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target;x-amz-security-token, Signature=string
x-amzn-transcribe-language-code: en-US
x-amzn-transcribe-media-encoding: flac
x-amzn-transcribe-sample-rate: 16000      
x-amzn-channel-identification: TRUE
transfer-encoding: chunked
```

Definisi parameter dapat ditemukan di [Referensi API](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Reference.html); parameter yang umum untuk semua operasi AWS API tercantum di bagian [Parameter Umum](https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonParameters.html).

### WebSocket aliran
<a name="channel-id-websocket"></a>

Contoh ini membuat URL presigned yang memisahkan saluran dalam output transkripsi Anda. Jeda baris telah ditambahkan untuk keterbacaan. Untuk informasi selengkapnya tentang penggunaan WebSocket stream denganAmazon Transcribe, lihat[Menyiapkan WebSocket aliran](streaming-setting-up.md#streaming-websocket). Untuk detail lebih lanjut tentang parameter, lihat [https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartStreamTranscription.html).

```
GET wss://transcribestreaming.us-west-2.amazonaws.com:8443/stream-transcription-websocket?
&X-Amz-Algorithm=AWS4-HMAC-SHA256
&X-Amz-Credential=AKIAIOSFODNN7EXAMPLE%2F20220208%2Fus-west-2%2Ftranscribe%2Faws4_request
&X-Amz-Date=20220208T235959Z
&X-Amz-Expires=300
&X-Amz-Security-Token=security-token
&X-Amz-Signature=string
&X-Amz-SignedHeaders=content-type%3Bhost%3Bx-amz-date
&language-code=en-US
&specialty=PRIMARYCARE
&type=DICTATION
&media-encoding=flac
&sample-rate=16000    
&channel-identification=TRUE
```

Definisi parameter dapat ditemukan di [Referensi API](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Reference.html); parameter yang umum untuk semua operasi AWS API tercantum di bagian [Parameter Umum](https://docs.aws.amazon.com/transcribe/latest/APIReference/CommonParameters.html).

# Contoh keluaran identifikasi saluran (batch)
<a name="channel-id-output-batch"></a>

Berikut adalah contoh keluaran untuk transkripsi batch dengan identifikasi saluran diaktifkan.

```
{
    "jobName": "my-first-transcription-job",
    "accountId": "111122223333",
    "results": {
        "transcripts": [
            {
                "transcript": "I've been on hold for an hour. Sorry about that."
            }
        ],
        "channel_labels": {
            "channels": [
                {
                    "channel_label": "ch_0",
                    "items": [                                      
                        {
                            "channel_label": "ch_0",
                            "start_time": "4.86",
                            "end_time": "5.01",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "I've"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_0",
                            "start_time": "5.01",
                            "end_time": "5.16",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "been"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_0",
                            "start_time": "5.16",
                            "end_time": "5.28",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "on"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_0",
                            "start_time": "5.28",
                            "end_time": "5.62",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "hold"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_0",
                            "start_time": "5.62",
                            "end_time": "5.83",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "for"
                                }
                            ],
                            "type": "pronunciation"
                        },              
                        {
                            "channel_label": "ch_0",
                            "start_time": "6.1",
                            "end_time": "6.25",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "an"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_0",
                            "start_time": "6.25",
                            "end_time": "6.87",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "hour"
                                }
                            ],
                            "type": "pronunciation"
                        },                      
                        {
                            "channel_label": "ch_0",
                            "language_code": "en-US",
                            "alternatives": [
                                {
                                    "confidence": "0.0",
                                    "content": "."
                                }
                            ],
                            "type": "punctuation"
                        }                      
                    ]
                },
                {                
                "channel_label": "ch_1",
                    "items": [
                        {
                            "channel_label": "ch_1",
                            "start_time": "8.5",
                            "end_time": "8.89",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "Sorry"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_1",
                            "start_time": "8.89",
                            "end_time": "9.06",
                            "alternatives": [
                                {
                                    "confidence": "0.9176",
                                    "content": "about"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_1",
                            "start_time": "9.06",
                            "end_time": "9.25",
                            "alternatives": [
                                {
                                    "confidence": "1.0",
                                    "content": "that"
                                }
                            ],
                            "type": "pronunciation"
                        },
                        {
                            "channel_label": "ch_1",
                            "alternatives": [
                                {
                                    "confidence": "0.0",
                                    "content": "."
                                }
                            ],
                            "type": "punctuation"
                        }                     
                    ]
                }
            ],
            "number_of_channels": 2
        },
        "items": [            
            {
                "id": 0,
                "channel_label": "ch_0",
                "start_time": "4.86",
                "end_time": "5.01",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "I've"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 1,
                "channel_label": "ch_0",
                "start_time": "5.01",
                "end_time": "5.16",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "been"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 2,
                "channel_label": "ch_0",
                "start_time": "5.16",
                "end_time": "5.28",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "on"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 3,
                "channel_label": "ch_0",
                "start_time": "5.28",
                "end_time": "5.62",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "hold"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 4,
                "channel_label": "ch_0",
                "start_time": "5.62",
                "end_time": "5.83",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "for"
                    }
                ],
                "type": "pronunciation"
            },            
            {
                "id": 5,
                "channel_label": "ch_0",
                "start_time": "6.1",
                "end_time": "6.25",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "an"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 6,
                "channel_label": "ch_0",
                "start_time": "6.25",
                "end_time": "6.87",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "hour"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 7,
                "channel_label": "ch_0",
                "alternatives": [
                    {
                        "confidence": "0.0",
                        "content": "."
                    }
                ],
                "type": "punctuation"
            },
            {
                "id": 8,
                "channel_label": "ch_1",
                "start_time": "8.5",
                "end_time": "8.89",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "Sorry"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 9,
                "channel_label": "ch_1",
                "start_time": "8.89",
                "end_time": "9.06",
                "alternatives": [
                    {
                        "confidence": "0.9176",
                        "content": "about"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 10,
                "channel_label": "ch_1",
                "start_time": "9.06",
                "end_time": "9.25",
                "alternatives": [
                    {
                        "confidence": "1.0",
                        "content": "that"
                    }
                ],
                "type": "pronunciation"
            },
            {
                "id": 11,
                "channel_label": "ch_1",
                "alternatives": [
                    {
                        "confidence": "0.0",
                        "content": "."
                    }
                ],
                "type": "punctuation"
            }
        ],
        "audio_segments": [
            {
                "id": 0,
                "transcript": "I've been on hold for an hour.",
                "start_time": "4.86",
                "end_time": "6.87",
                "channel_label": "ch_0",
                "items": [
                    0,
                    1,
                    2,
                    3,
                    4,
                    5,
                    6,
                    7
                ]
            },
            {
                "id": 1,
                "transcript": "Sorry about that.",
                "start_time": "8.5",
                "end_time": "9.25",
                "channel_label": "ch_1",
                "items": [
                    8,
                    9,
                    10,
                    11
                ]
            }
        ]
    },
    "status": "COMPLETED"
}
```