You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::TranscribeService::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



163
164
165
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 163

def initialize(*args)
  super
end

Instance Method Details

#create_vocabulary(params = {}) ⇒ Types::CreateVocabularyResponse

Creates a new custom vocabulary that you can use to change the way Amazon Transcribe handles transcription of an audio file.

Examples:

Request syntax with placeholder values


resp = client.create_vocabulary({
  vocabulary_name: "VocabularyName", # required
  language_code: "en-US", # required, accepts en-US, es-US
  phrases: ["Phrase"], # required
})

Response structure


resp.vocabulary_name #=> String
resp.language_code #=> String, one of "en-US", "es-US"
resp.vocabulary_state #=> String, one of "PENDING", "READY", "FAILED"
resp.last_modified_time #=> Time
resp.failure_reason #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :vocabulary_name (required, String)

    The name of the vocabulary. The name must be unique within an AWS account. The name is case-sensitive.

  • :language_code (required, String)

    The language code of the vocabulary entries.

  • :phrases (required, Array<String>)

    An array of strings that contains the vocabulary entries.

Returns:

See Also:



210
211
212
213
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 210

def create_vocabulary(params = {}, options = {})
  req = build_request(:create_vocabulary, params)
  req.send_request(options)
end

#delete_vocabulary(params = {}) ⇒ Struct

Deletes a vocabulary from Amazon Transcribe.

Examples:

Request syntax with placeholder values


resp = client.delete_vocabulary({
  vocabulary_name: "VocabularyName", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :vocabulary_name (required, String)

    The name of the vocabulary to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



232
233
234
235
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 232

def delete_vocabulary(params = {}, options = {})
  req = build_request(:delete_vocabulary, params)
  req.send_request(options)
end

#get_transcription_job(params = {}) ⇒ Types::GetTranscriptionJobResponse

Returns information about a transcription job. To see the status of the job, check the TranscriptionJobStatus field. If the status is COMPLETED, the job is finished and you can find the results at the location specified in the TranscriptionFileUri field.

Examples:

Request syntax with placeholder values


resp = client.get_transcription_job({
  transcription_job_name: "TranscriptionJobName", # required
})

Response structure


resp.transcription_job.transcription_job_name #=> String
resp.transcription_job.transcription_job_status #=> String, one of "IN_PROGRESS", "FAILED", "COMPLETED"
resp.transcription_job.language_code #=> String, one of "en-US", "es-US"
resp.transcription_job.media_sample_rate_hertz #=> Integer
resp.transcription_job.media_format #=> String, one of "mp3", "mp4", "wav", "flac"
resp.transcription_job.media.media_file_uri #=> String
resp.transcription_job.transcript.transcript_file_uri #=> String
resp.transcription_job.creation_time #=> Time
resp.transcription_job.completion_time #=> Time
resp.transcription_job.failure_reason #=> String
resp.transcription_job.settings.vocabulary_name #=> String
resp.transcription_job.settings.show_speaker_labels #=> Boolean
resp.transcription_job.settings.max_speaker_labels #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :transcription_job_name (required, String)

    The name of the job.

Returns:

See Also:



275
276
277
278
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 275

def get_transcription_job(params = {}, options = {})
  req = build_request(:get_transcription_job, params)
  req.send_request(options)
end

#get_vocabulary(params = {}) ⇒ Types::GetVocabularyResponse

Gets information about a vocabulary.

Examples:

Request syntax with placeholder values


resp = client.get_vocabulary({
  vocabulary_name: "VocabularyName", # required
})

Response structure


resp.vocabulary_name #=> String
resp.language_code #=> String, one of "en-US", "es-US"
resp.vocabulary_state #=> String, one of "PENDING", "READY", "FAILED"
resp.last_modified_time #=> Time
resp.failure_reason #=> String
resp.download_uri #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :vocabulary_name (required, String)

    The name of the vocabulary to return information about. The name is case-sensitive.

Returns:

See Also:



314
315
316
317
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 314

def get_vocabulary(params = {}, options = {})
  req = build_request(:get_vocabulary, params)
  req.send_request(options)
end

#list_transcription_jobs(params = {}) ⇒ Types::ListTranscriptionJobsResponse

Lists transcription jobs with the specified status.

Examples:

Request syntax with placeholder values


resp = client.list_transcription_jobs({
  status: "IN_PROGRESS", # accepts IN_PROGRESS, FAILED, COMPLETED
  job_name_contains: "TranscriptionJobName",
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.status #=> String, one of "IN_PROGRESS", "FAILED", "COMPLETED"
resp.next_token #=> String
resp.transcription_job_summaries #=> Array
resp.transcription_job_summaries[0].transcription_job_name #=> String
resp.transcription_job_summaries[0].creation_time #=> Time
resp.transcription_job_summaries[0].completion_time #=> Time
resp.transcription_job_summaries[0].language_code #=> String, one of "en-US", "es-US"
resp.transcription_job_summaries[0].transcription_job_status #=> String, one of "IN_PROGRESS", "FAILED", "COMPLETED"
resp.transcription_job_summaries[0].failure_reason #=> String
resp.transcription_job_summaries[0].output_location_type #=> String, one of "CUSTOMER_BUCKET", "SERVICE_BUCKET"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :status (String)

    When specified, returns only transcription jobs with the specified status.

  • :job_name_contains (String)

    When specified, the jobs returned in the list are limited to jobs whose name contains the specified string.

  • :next_token (String)

    If the result of the previous request to ListTranscriptionJobs was truncated, include the NextToken to fetch the next set of jobs.

  • :max_results (Integer)

    The maximum number of jobs to return in the response. If there are fewer results in the list, this response contains only the actual results.

Returns:

See Also:



370
371
372
373
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 370

def list_transcription_jobs(params = {}, options = {})
  req = build_request(:list_transcription_jobs, params)
  req.send_request(options)
end

#list_vocabularies(params = {}) ⇒ Types::ListVocabulariesResponse

Returns a list of vocabularies that match the specified criteria. If no criteria are specified, returns the entire list of vocabularies.

Examples:

Request syntax with placeholder values


resp = client.list_vocabularies({
  next_token: "NextToken",
  max_results: 1,
  state_equals: "PENDING", # accepts PENDING, READY, FAILED
  name_contains: "VocabularyName",
})

Response structure


resp.status #=> String, one of "IN_PROGRESS", "FAILED", "COMPLETED"
resp.next_token #=> String
resp.vocabularies #=> Array
resp.vocabularies[0].vocabulary_name #=> String
resp.vocabularies[0].language_code #=> String, one of "en-US", "es-US"
resp.vocabularies[0].last_modified_time #=> Time
resp.vocabularies[0].vocabulary_state #=> String, one of "PENDING", "READY", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :next_token (String)

    If the result of the previous request to ListVocabularies was truncated, include the NextToken to fetch the next set of jobs.

  • :max_results (Integer)

    The maximum number of vocabularies to return in the response. If there are fewer results in the list, this response contains only the actual results.

  • :state_equals (String)

    When specified, only returns vocabularies with the VocabularyState field equal to the specified state.

  • :name_contains (String)

    When specified, the vocabularies returned in the list are limited to vocabularies whose name contains the specified string. The search is case-insensitive, ListVocabularies will return both "vocabularyname" and "VocabularyName" in the response list.

Returns:

See Also:



426
427
428
429
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 426

def list_vocabularies(params = {}, options = {})
  req = build_request(:list_vocabularies, params)
  req.send_request(options)
end

#start_transcription_job(params = {}) ⇒ Types::StartTranscriptionJobResponse

Starts an asynchronous job to transcribe speech to text.

Examples:

Request syntax with placeholder values


resp = client.start_transcription_job({
  transcription_job_name: "TranscriptionJobName", # required
  language_code: "en-US", # required, accepts en-US, es-US
  media_sample_rate_hertz: 1,
  media_format: "mp3", # required, accepts mp3, mp4, wav, flac
  media: { # required
    media_file_uri: "Uri",
  },
  output_bucket_name: "OutputBucketName",
  settings: {
    vocabulary_name: "VocabularyName",
    show_speaker_labels: false,
    max_speaker_labels: 1,
  },
})

Response structure


resp.transcription_job.transcription_job_name #=> String
resp.transcription_job.transcription_job_status #=> String, one of "IN_PROGRESS", "FAILED", "COMPLETED"
resp.transcription_job.language_code #=> String, one of "en-US", "es-US"
resp.transcription_job.media_sample_rate_hertz #=> Integer
resp.transcription_job.media_format #=> String, one of "mp3", "mp4", "wav", "flac"
resp.transcription_job.media.media_file_uri #=> String
resp.transcription_job.transcript.transcript_file_uri #=> String
resp.transcription_job.creation_time #=> Time
resp.transcription_job.completion_time #=> Time
resp.transcription_job.failure_reason #=> String
resp.transcription_job.settings.vocabulary_name #=> String
resp.transcription_job.settings.show_speaker_labels #=> Boolean
resp.transcription_job.settings.max_speaker_labels #=> Integer

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :transcription_job_name (required, String)

    The name of the job. You can't use the strings "." or ".." in the job name. The name must be unique within an AWS account.

  • :language_code (required, String)

    The language code for the language used in the input media file.

  • :media_sample_rate_hertz (Integer)

    The sample rate, in Hertz, of the audio track in the input media file.

  • :media_format (required, String)

    The format of the input media file.

  • :media (required, Types::Media)

    An object that describes the input media for a transcription job.

  • :output_bucket_name (String)

    The location where the transcription is stored.

    If you set the OutputBucketName, Amazon Transcribe puts the transcription in the specified S3 bucket. When you call the GetTranscriptionJob operation, the operation returns this location in the TranscriptFileUri field. The S3 bucket must have permissions that allow Amazon Transcribe to put files in the bucket. For more information, see Permissions Required for IAM User Roles.

    If you don't set the OutputBucketName, Amazon Transcribe generates a pre-signed URL, a shareable URL that provides secure access to your transcription, and returns it in the TranscriptFileUri field. Use this URL to download the transcription.

  • :settings (Types::Settings)

    A Settings object that provides optional settings for a transcription job.

Returns:

See Also:



514
515
516
517
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 514

def start_transcription_job(params = {}, options = {})
  req = build_request(:start_transcription_job, params)
  req.send_request(options)
end

#update_vocabulary(params = {}) ⇒ Types::UpdateVocabularyResponse

Updates an existing vocabulary with new values. The UpdateVocabulary operation overwrites all of the existing information with the values that you provide in the request.

Examples:

Request syntax with placeholder values


resp = client.update_vocabulary({
  vocabulary_name: "VocabularyName", # required
  language_code: "en-US", # required, accepts en-US, es-US
  phrases: ["Phrase"], # required
})

Response structure


resp.vocabulary_name #=> String
resp.language_code #=> String, one of "en-US", "es-US"
resp.last_modified_time #=> Time
resp.vocabulary_state #=> String, one of "PENDING", "READY", "FAILED"

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :vocabulary_name (required, String)

    The name of the vocabulary to update. The name is case-sensitive.

  • :language_code (required, String)

    The language code of the vocabulary entries.

  • :phrases (required, Array<String>)

    An array of strings containing the vocabulary entries.

Returns:

See Also:



558
559
560
561
# File 'gems/aws-sdk-transcribeservice/lib/aws-sdk-transcribeservice/client.rb', line 558

def update_vocabulary(params = {}, options = {})
  req = build_request(:update_vocabulary, params)
  req.send_request(options)
end