Back to Aws Doc Sdk Examples

AWS SDK for Rust code examples for Amazon Transcribe

rustv1/examples/transcribestreaming/README.md

latest2.0 KB
Original Source

AWS SDK for Rust code examples for Amazon Transcribe

Amazon Transcribe provides transcription services for audio files.

Purpose

This example demonstrate how to perform an Amazon Transcribe operation using the alpha version of the AWS SDK for Rust.

Prerequisites

You must have an AWS account, and have configured your default credentials and AWS Region as described in https://github.com/awslabs/aws-sdk-rust.

Running the code

transcribestreaming

This example displays a transcription of a WAV audio file.

cargo run -- -a AUDIO-FILE [-r REGION] [-v]

  • AUDIO-FILE is the name of the audio file to transcribe. It must be in WAV format; the example converts the WAV file content to pcm format for Amazon Transcribe. Note that Amazon Transcribe supports encoding in pcm, ogg-opus, and flac formats.
  • REGION is the Region in which the client is created. If not supplied, uses the value of the AWS_REGION environment variable. If the environment variable is not set, defaults to us-west-2.
  • -v displays additional information.

If you run it with the WAV file in .audio/hello-transcribe-8000.wav, you should see the following transcribed text:

Good day to you transcribe.
This is Polly talking to you from the Rust ST K.

Notes

  • We recommend that you grant this code least privilege, or at most the minimum permissions required to perform the task. For more information, see Grant Least Privilege in the AWS Identity and Access Management User Guide.
  • This code has not been tested in all AWS Regions. Some AWS services are available only in specific Regions.
  • Running this code might result in charges to your AWS account.

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0