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 |
A Cloudyr Project Package
This is a template package for the cloudyr project
Thomas J. Leeper <[email protected]>
start_transcription
, list_transcriptions
, get_transcription
Retrieve a specific AWS Transcribe job
get_transcription(job, download = TRUE, ...)
get_transcription(job, download = TRUE, ...)
job |
A character string specifying the name of a job, possibly returned by |
download |
A logical indicating whether to download the transcription(s). |
... |
Additional arguments passed to |
A list.
start_transcription
, list_transcriptions
## 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)
## 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, by status
list_transcriptions( status = c("COMPLETED", "IN_PROGRESS", "FAILED"), n = NULL, token = NULL, ... )
list_transcriptions( status = c("COMPLETED", "IN_PROGRESS", "FAILED"), n = NULL, token = NULL, ... )
status |
A character string specifying the status of jobs to retrieve. Use |
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 |
A list.
## Not run: list_transcriptions("COMPLETED") ## End(Not run)
## Not run: list_transcriptions("COMPLETED") ## End(Not run)
Start an AWS Transcribe job
start_transcription( name, url, format = tools::file_ext(url), language = "en-US", hertz = NULL, ... )
start_transcription( name, url, format = tools::file_ext(url), language = "en-US", hertz = NULL, ... )
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 |
A list containing details of the job. The transcript can be retrieved with get_transcription
.
## 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)
## 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)
This is the workhorse function to execute calls to the Transcribe API.
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, ... )
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, ... )
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 |
region |
A character string specifying an AWS region. See |
key |
A character string specifying an AWS Access Key. See |
secret |
A character string specifying an AWS Secret Key. See |
session_token |
Optionally, a character string specifying an AWS temporary Session Token to use in signing a request. See |
... |
Additional arguments passed to |
This function constructs and signs an Transcribe API request and returns the results thereof, or relevant debugging information in the case of error.
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.
Thomas J. Leeper