Package 'aws.transcribe'

Title: Client for 'AWS Transcribe'
Description: Client for 'AWS Transcribe' <https://aws.amazon.com/documentation/transcribe>, a cloud transcription service that can convert an audio media file in English and other languages into a text transcript.
Authors: Thomas J. Leeper [aut] , Antoine Sachet [cre]
Maintainer: Antoine Sachet <[email protected]>
License: GPL (>= 2)
Version: 0.1.3.9000
Built: 2024-10-24 03:58:19 UTC
Source: https://github.com/cloudyr/aws.transcribe

Help Index


aws.transcribe

Description

A Cloudyr Project Package

Details

This is a template package for the cloudyr project

Author(s)

Thomas J. Leeper <[email protected]>

See Also

start_transcription, list_transcriptions, get_transcription


Get AWS Transcribe Job

Description

Retrieve a specific AWS Transcribe job

Usage

get_transcription(job, download = TRUE, ...)

Arguments

job

A character string specifying the name of a job, possibly returned by list_transcriptions.

download

A logical indicating whether to download the transcription(s).

...

Additional arguments passed to transcribeHTTP.

Value

A list.

See Also

start_transcription, list_transcriptions

Examples

## Not run: 
# start a transcription
## upload a file to S3
library("aws.s3")
put_object(file = "recording.mp3", bucket = "my-bucket", object = "recording.mp3")

## start trancription
start_transcription("first-example", "https://my-bucket.us-east-1.amazonaws.com/recording.mp3")

## wait
Sys.sleep(5)

## retrieve transcription
transcript <- get_transcription("first-example")
transcript$Transcriptions

## End(Not run)

List AWS Transcribe Jobs

Description

List AWS Transcribe jobs, by status

Usage

list_transcriptions(
  status = c("COMPLETED", "IN_PROGRESS", "FAILED"),
  n = NULL,
  token = NULL,
  ...
)

Arguments

status

A character string specifying the status of jobs to retrieve. Use get_transcription to retrieve a specific transcription.

n

Optionally, a numeric value indicating the maximum number of results to return (for pagination).

token

Optionally, a “NextToken” indicating the next result to retrieve (for pagination).

...

Additional arguments passed to transcribeHTTP.

Value

A list.

Examples

## Not run: 
list_transcriptions("COMPLETED")

## End(Not run)

Start AWS Transcribe Job

Description

Start an AWS Transcribe job

Usage

start_transcription(
  name,
  url,
  format = tools::file_ext(url),
  language = "en-US",
  hertz = NULL,
  ...
)

Arguments

name

A character string specifying a unique name for the transcription job.

url

A character string specifying a URL for the media file to be transcribed.

format

A character string specifying the file format. One of: “mp3”, “mp4”, “wav”, “flac”.

language

A character string specifying a language code. Currently defaults to “en-US”.

hertz

Optionally, a numeric value specifying sample rate in Hertz.

...

Additional arguments passed to transcribeHTTP.

Value

A list containing details of the job. The transcript can be retrieved with get_transcription.

See Also

get_transcription

Examples

## Not run: 
# start a transcription
## upload a file to S3
library("aws.s3")
put_object(file = "recording.mp3", bucket = "my-bucket", object = "recording.mp3")

## start trancription
start_transcription("first-example", "https://my-bucket.us-east-1.amazonaws.com/recording.mp3")

## End(Not run)

Execute AWS Transcribe API Request

Description

This is the workhorse function to execute calls to the Transcribe API.

Usage

transcribeHTTP(
  action,
  headers = list(),
  query = list(),
  body = NULL,
  version = "v1",
  verbose = getOption("verbose", FALSE),
  region = Sys.getenv("AWS_DEFAULT_REGION", "us-east-1"),
  key = NULL,
  secret = NULL,
  session_token = NULL,
  ...
)

Arguments

action

A character string specifying an API endpoint.

headers

A list of headers to pass to the HTTP request.

query

An optional named list containing query string parameters and their character values.

body

A request body

version

A character string specifying the API version.

verbose

A logical indicating whether to be verbose. Default is given by options("verbose").

region

A character string specifying an AWS region. See locate_credentials.

key

A character string specifying an AWS Access Key. See locate_credentials.

secret

A character string specifying an AWS Secret Key. See locate_credentials.

session_token

Optionally, a character string specifying an AWS temporary Session Token to use in signing a request. See locate_credentials.

...

Additional arguments passed to GET.

Details

This function constructs and signs an Transcribe API request and returns the results thereof, or relevant debugging information in the case of error.

Value

If successful, a named list. Otherwise, a data structure of class “aws-error” containing any error message(s) from AWS and information about the request attempt.

Author(s)

Thomas J. Leeper