UNPKG

22.8 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class TranscribeService extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: TranscribeService.Types.ClientConfiguration)
13 config: Config & TranscribeService.Types.ClientConfiguration;
14 /**
15 * Creates a new custom vocabulary that you can use to change the way Amazon Transcribe handles transcription of an audio file.
16 */
17 createVocabulary(params: TranscribeService.Types.CreateVocabularyRequest, callback?: (err: AWSError, data: TranscribeService.Types.CreateVocabularyResponse) => void): Request<TranscribeService.Types.CreateVocabularyResponse, AWSError>;
18 /**
19 * Creates a new custom vocabulary that you can use to change the way Amazon Transcribe handles transcription of an audio file.
20 */
21 createVocabulary(callback?: (err: AWSError, data: TranscribeService.Types.CreateVocabularyResponse) => void): Request<TranscribeService.Types.CreateVocabularyResponse, AWSError>;
22 /**
23 * Deletes a previously submitted transcription job along with any other generated results such as the transcription, models, and so on.
24 */
25 deleteTranscriptionJob(params: TranscribeService.Types.DeleteTranscriptionJobRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
26 /**
27 * Deletes a previously submitted transcription job along with any other generated results such as the transcription, models, and so on.
28 */
29 deleteTranscriptionJob(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
30 /**
31 * Deletes a vocabulary from Amazon Transcribe.
32 */
33 deleteVocabulary(params: TranscribeService.Types.DeleteVocabularyRequest, callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
34 /**
35 * Deletes a vocabulary from Amazon Transcribe.
36 */
37 deleteVocabulary(callback?: (err: AWSError, data: {}) => void): Request<{}, AWSError>;
38 /**
39 * 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.
40 */
41 getTranscriptionJob(params: TranscribeService.Types.GetTranscriptionJobRequest, callback?: (err: AWSError, data: TranscribeService.Types.GetTranscriptionJobResponse) => void): Request<TranscribeService.Types.GetTranscriptionJobResponse, AWSError>;
42 /**
43 * 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.
44 */
45 getTranscriptionJob(callback?: (err: AWSError, data: TranscribeService.Types.GetTranscriptionJobResponse) => void): Request<TranscribeService.Types.GetTranscriptionJobResponse, AWSError>;
46 /**
47 * Gets information about a vocabulary.
48 */
49 getVocabulary(params: TranscribeService.Types.GetVocabularyRequest, callback?: (err: AWSError, data: TranscribeService.Types.GetVocabularyResponse) => void): Request<TranscribeService.Types.GetVocabularyResponse, AWSError>;
50 /**
51 * Gets information about a vocabulary.
52 */
53 getVocabulary(callback?: (err: AWSError, data: TranscribeService.Types.GetVocabularyResponse) => void): Request<TranscribeService.Types.GetVocabularyResponse, AWSError>;
54 /**
55 * Lists transcription jobs with the specified status.
56 */
57 listTranscriptionJobs(params: TranscribeService.Types.ListTranscriptionJobsRequest, callback?: (err: AWSError, data: TranscribeService.Types.ListTranscriptionJobsResponse) => void): Request<TranscribeService.Types.ListTranscriptionJobsResponse, AWSError>;
58 /**
59 * Lists transcription jobs with the specified status.
60 */
61 listTranscriptionJobs(callback?: (err: AWSError, data: TranscribeService.Types.ListTranscriptionJobsResponse) => void): Request<TranscribeService.Types.ListTranscriptionJobsResponse, AWSError>;
62 /**
63 * Returns a list of vocabularies that match the specified criteria. If no criteria are specified, returns the entire list of vocabularies.
64 */
65 listVocabularies(params: TranscribeService.Types.ListVocabulariesRequest, callback?: (err: AWSError, data: TranscribeService.Types.ListVocabulariesResponse) => void): Request<TranscribeService.Types.ListVocabulariesResponse, AWSError>;
66 /**
67 * Returns a list of vocabularies that match the specified criteria. If no criteria are specified, returns the entire list of vocabularies.
68 */
69 listVocabularies(callback?: (err: AWSError, data: TranscribeService.Types.ListVocabulariesResponse) => void): Request<TranscribeService.Types.ListVocabulariesResponse, AWSError>;
70 /**
71 * Starts an asynchronous job to transcribe speech to text.
72 */
73 startTranscriptionJob(params: TranscribeService.Types.StartTranscriptionJobRequest, callback?: (err: AWSError, data: TranscribeService.Types.StartTranscriptionJobResponse) => void): Request<TranscribeService.Types.StartTranscriptionJobResponse, AWSError>;
74 /**
75 * Starts an asynchronous job to transcribe speech to text.
76 */
77 startTranscriptionJob(callback?: (err: AWSError, data: TranscribeService.Types.StartTranscriptionJobResponse) => void): Request<TranscribeService.Types.StartTranscriptionJobResponse, AWSError>;
78 /**
79 * 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.
80 */
81 updateVocabulary(params: TranscribeService.Types.UpdateVocabularyRequest, callback?: (err: AWSError, data: TranscribeService.Types.UpdateVocabularyResponse) => void): Request<TranscribeService.Types.UpdateVocabularyResponse, AWSError>;
82 /**
83 * 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.
84 */
85 updateVocabulary(callback?: (err: AWSError, data: TranscribeService.Types.UpdateVocabularyResponse) => void): Request<TranscribeService.Types.UpdateVocabularyResponse, AWSError>;
86}
87declare namespace TranscribeService {
88 export type Boolean = boolean;
89 export interface CreateVocabularyRequest {
90 /**
91 * The name of the vocabulary. The name must be unique within an AWS account. The name is case-sensitive.
92 */
93 VocabularyName: VocabularyName;
94 /**
95 * The language code of the vocabulary entries.
96 */
97 LanguageCode: LanguageCode;
98 /**
99 * An array of strings that contains the vocabulary entries.
100 */
101 Phrases: Phrases;
102 }
103 export interface CreateVocabularyResponse {
104 /**
105 * The name of the vocabulary.
106 */
107 VocabularyName?: VocabularyName;
108 /**
109 * The language code of the vocabulary entries.
110 */
111 LanguageCode?: LanguageCode;
112 /**
113 * The processing state of the vocabulary. When the VocabularyState field contains READY the vocabulary is ready to be used in a StartTranscriptionJob request.
114 */
115 VocabularyState?: VocabularyState;
116 /**
117 * The date and time that the vocabulary was created.
118 */
119 LastModifiedTime?: DateTime;
120 /**
121 * If the VocabularyState field is FAILED, this field contains information about why the job failed.
122 */
123 FailureReason?: FailureReason;
124 }
125 export type DateTime = Date;
126 export interface DeleteTranscriptionJobRequest {
127 /**
128 * The name of the transcription job to be deleted.
129 */
130 TranscriptionJobName: TranscriptionJobName;
131 }
132 export interface DeleteVocabularyRequest {
133 /**
134 * The name of the vocabulary to delete.
135 */
136 VocabularyName: VocabularyName;
137 }
138 export type FailureReason = string;
139 export interface GetTranscriptionJobRequest {
140 /**
141 * The name of the job.
142 */
143 TranscriptionJobName: TranscriptionJobName;
144 }
145 export interface GetTranscriptionJobResponse {
146 /**
147 * An object that contains the results of the transcription job.
148 */
149 TranscriptionJob?: TranscriptionJob;
150 }
151 export interface GetVocabularyRequest {
152 /**
153 * The name of the vocabulary to return information about. The name is case-sensitive.
154 */
155 VocabularyName: VocabularyName;
156 }
157 export interface GetVocabularyResponse {
158 /**
159 * The name of the vocabulary to return.
160 */
161 VocabularyName?: VocabularyName;
162 /**
163 * The language code of the vocabulary entries.
164 */
165 LanguageCode?: LanguageCode;
166 /**
167 * The processing state of the vocabulary.
168 */
169 VocabularyState?: VocabularyState;
170 /**
171 * The date and time that the vocabulary was last modified.
172 */
173 LastModifiedTime?: DateTime;
174 /**
175 * If the VocabularyState field is FAILED, this field contains information about why the job failed.
176 */
177 FailureReason?: FailureReason;
178 /**
179 * The S3 location where the vocabulary is stored. Use this URI to get the contents of the vocabulary. The URI is available for a limited time.
180 */
181 DownloadUri?: Uri;
182 }
183 export type LanguageCode = "en-US"|"es-US"|"en-AU"|"fr-CA"|"en-GB"|"de-DE"|"pt-BR"|"fr-FR"|"it-IT"|string;
184 export interface ListTranscriptionJobsRequest {
185 /**
186 * When specified, returns only transcription jobs with the specified status. Jobs are ordered by creation date, with the newest jobs returned first. If you don’t specify a status, Amazon Transcribe returns all transcription jobs ordered by creation date.
187 */
188 Status?: TranscriptionJobStatus;
189 /**
190 * When specified, the jobs returned in the list are limited to jobs whose name contains the specified string.
191 */
192 JobNameContains?: TranscriptionJobName;
193 /**
194 * If the result of the previous request to ListTranscriptionJobs was truncated, include the NextToken to fetch the next set of jobs.
195 */
196 NextToken?: NextToken;
197 /**
198 * 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.
199 */
200 MaxResults?: MaxResults;
201 }
202 export interface ListTranscriptionJobsResponse {
203 /**
204 * The requested status of the jobs returned.
205 */
206 Status?: TranscriptionJobStatus;
207 /**
208 * The ListTranscriptionJobs operation returns a page of jobs at a time. The maximum size of the page is set by the MaxResults parameter. If there are more jobs in the list than the page size, Amazon Transcribe returns the NextPage token. Include the token in the next request to the ListTranscriptionJobs operation to return in the next page of jobs.
209 */
210 NextToken?: NextToken;
211 /**
212 * A list of objects containing summary information for a transcription job.
213 */
214 TranscriptionJobSummaries?: TranscriptionJobSummaries;
215 }
216 export interface ListVocabulariesRequest {
217 /**
218 * If the result of the previous request to ListVocabularies was truncated, include the NextToken to fetch the next set of jobs.
219 */
220 NextToken?: NextToken;
221 /**
222 * 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.
223 */
224 MaxResults?: MaxResults;
225 /**
226 * When specified, only returns vocabularies with the VocabularyState field equal to the specified state.
227 */
228 StateEquals?: VocabularyState;
229 /**
230 * 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.
231 */
232 NameContains?: VocabularyName;
233 }
234 export interface ListVocabulariesResponse {
235 /**
236 * The requested vocabulary state.
237 */
238 Status?: TranscriptionJobStatus;
239 /**
240 * The ListVocabularies operation returns a page of vocabularies at a time. The maximum size of the page is set by the MaxResults parameter. If there are more jobs in the list than the page size, Amazon Transcribe returns the NextPage token. Include the token in the next request to the ListVocabularies operation to return in the next page of jobs.
241 */
242 NextToken?: NextToken;
243 /**
244 * A list of objects that describe the vocabularies that match the search criteria in the request.
245 */
246 Vocabularies?: Vocabularies;
247 }
248 export type MaxResults = number;
249 export type MaxSpeakers = number;
250 export interface Media {
251 /**
252 * The S3 location of the input media file. The URI must be in the same region as the API endpoint that you are calling. The general form is: https://s3-&lt;aws-region&gt;.amazonaws.com/&lt;bucket-name&gt;/&lt;keyprefix&gt;/&lt;objectkey&gt; For example: https://s3-us-east-1.amazonaws.com/examplebucket/example.mp4 https://s3-us-east-1.amazonaws.com/examplebucket/mediadocs/example.mp4 For more information about S3 object names, see Object Keys in the Amazon S3 Developer Guide.
253 */
254 MediaFileUri?: Uri;
255 }
256 export type MediaFormat = "mp3"|"mp4"|"wav"|"flac"|string;
257 export type MediaSampleRateHertz = number;
258 export type NextToken = string;
259 export type OutputBucketName = string;
260 export type OutputLocationType = "CUSTOMER_BUCKET"|"SERVICE_BUCKET"|string;
261 export type Phrase = string;
262 export type Phrases = Phrase[];
263 export interface Settings {
264 /**
265 * The name of a vocabulary to use when processing the transcription job.
266 */
267 VocabularyName?: VocabularyName;
268 /**
269 * Determines whether the transcription job uses speaker recognition to identify different speakers in the input audio. Speaker recognition labels individual speakers in the audio file. If you set the ShowSpeakerLabels field to true, you must also set the maximum number of speaker labels MaxSpeakerLabels field. You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException.
270 */
271 ShowSpeakerLabels?: Boolean;
272 /**
273 * The maximum number of speakers to identify in the input audio. If there are more speakers in the audio than this number, multiple speakers will be identified as a single speaker. If you specify the MaxSpeakerLabels field, you must set the ShowSpeakerLabels field to true.
274 */
275 MaxSpeakerLabels?: MaxSpeakers;
276 /**
277 * Instructs Amazon Transcribe to process each audio channel separately and then merge the transcription output of each channel into a single transcription. Amazon Transcribe also produces a transcription of each item detected on an audio channel, including the start time and end time of the item and alternative transcriptions of the item including the confidence that Amazon Transcribe has in the transcription. You can't set both ShowSpeakerLabels and ChannelIdentification in the same request. If you set both, your request returns a BadRequestException.
278 */
279 ChannelIdentification?: Boolean;
280 }
281 export interface StartTranscriptionJobRequest {
282 /**
283 * The name of the job. Note that you can't use the strings "." or ".." by themselves as the job name. The name must also be unique within an AWS account.
284 */
285 TranscriptionJobName: TranscriptionJobName;
286 /**
287 * The language code for the language used in the input media file.
288 */
289 LanguageCode: LanguageCode;
290 /**
291 * The sample rate, in Hertz, of the audio track in the input media file.
292 */
293 MediaSampleRateHertz?: MediaSampleRateHertz;
294 /**
295 * The format of the input media file.
296 */
297 MediaFormat: MediaFormat;
298 /**
299 * An object that describes the input media for a transcription job.
300 */
301 Media: Media;
302 /**
303 * 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.
304 */
305 OutputBucketName?: OutputBucketName;
306 /**
307 * A Settings object that provides optional settings for a transcription job.
308 */
309 Settings?: Settings;
310 }
311 export interface StartTranscriptionJobResponse {
312 /**
313 * An object containing details of the asynchronous transcription job.
314 */
315 TranscriptionJob?: TranscriptionJob;
316 }
317 export interface Transcript {
318 /**
319 * The location where the transcription is stored. Use this URI to access the transcription. If you specified an S3 bucket in the OutputBucketName field when you created the job, this is the URI of that bucket. If you chose to store the transcription in Amazon Transcribe, this is a shareable URL that provides secure access to that location.
320 */
321 TranscriptFileUri?: Uri;
322 }
323 export interface TranscriptionJob {
324 /**
325 * The name of the transcription job.
326 */
327 TranscriptionJobName?: TranscriptionJobName;
328 /**
329 * The status of the transcription job.
330 */
331 TranscriptionJobStatus?: TranscriptionJobStatus;
332 /**
333 * The language code for the input speech.
334 */
335 LanguageCode?: LanguageCode;
336 /**
337 * The sample rate, in Hertz, of the audio track in the input media file.
338 */
339 MediaSampleRateHertz?: MediaSampleRateHertz;
340 /**
341 * The format of the input media file.
342 */
343 MediaFormat?: MediaFormat;
344 /**
345 * An object that describes the input media for the transcription job.
346 */
347 Media?: Media;
348 /**
349 * An object that describes the output of the transcription job.
350 */
351 Transcript?: Transcript;
352 /**
353 * A timestamp that shows when the job was created.
354 */
355 CreationTime?: DateTime;
356 /**
357 * A timestamp that shows when the job was completed.
358 */
359 CompletionTime?: DateTime;
360 /**
361 * If the TranscriptionJobStatus field is FAILED, this field contains information about why the job failed.
362 */
363 FailureReason?: FailureReason;
364 /**
365 * Optional settings for the transcription job. Use these settings to turn on speaker recognition, to set the maximum number of speakers that should be identified and to specify a custom vocabulary to use when processing the transcription job.
366 */
367 Settings?: Settings;
368 }
369 export type TranscriptionJobName = string;
370 export type TranscriptionJobStatus = "IN_PROGRESS"|"FAILED"|"COMPLETED"|string;
371 export type TranscriptionJobSummaries = TranscriptionJobSummary[];
372 export interface TranscriptionJobSummary {
373 /**
374 * The name of the transcription job.
375 */
376 TranscriptionJobName?: TranscriptionJobName;
377 /**
378 * A timestamp that shows when the job was created.
379 */
380 CreationTime?: DateTime;
381 /**
382 * A timestamp that shows when the job was completed.
383 */
384 CompletionTime?: DateTime;
385 /**
386 * The language code for the input speech.
387 */
388 LanguageCode?: LanguageCode;
389 /**
390 * The status of the transcription job. When the status is COMPLETED, use the GetTranscriptionJob operation to get the results of the transcription.
391 */
392 TranscriptionJobStatus?: TranscriptionJobStatus;
393 /**
394 * If the TranscriptionJobStatus field is FAILED, a description of the error.
395 */
396 FailureReason?: FailureReason;
397 /**
398 * Indicates the location of the output of the transcription job. If the value is CUSTOMER_BUCKET then the location is the S3 bucket specified in the outputBucketName field when the transcription job was started with the StartTranscriptionJob operation. If the value is SERVICE_BUCKET then the output is stored by Amazon Transcribe and can be retrieved using the URI in the GetTranscriptionJob response's TranscriptFileUri field.
399 */
400 OutputLocationType?: OutputLocationType;
401 }
402 export interface UpdateVocabularyRequest {
403 /**
404 * The name of the vocabulary to update. The name is case-sensitive.
405 */
406 VocabularyName: VocabularyName;
407 /**
408 * The language code of the vocabulary entries.
409 */
410 LanguageCode: LanguageCode;
411 /**
412 * An array of strings containing the vocabulary entries.
413 */
414 Phrases: Phrases;
415 }
416 export interface UpdateVocabularyResponse {
417 /**
418 * The name of the vocabulary that was updated.
419 */
420 VocabularyName?: VocabularyName;
421 /**
422 * The language code of the vocabulary entries.
423 */
424 LanguageCode?: LanguageCode;
425 /**
426 * The date and time that the vocabulary was updated.
427 */
428 LastModifiedTime?: DateTime;
429 /**
430 * The processing state of the vocabulary. When the VocabularyState field contains READY the vocabulary is ready to be used in a StartTranscriptionJob request.
431 */
432 VocabularyState?: VocabularyState;
433 }
434 export type Uri = string;
435 export type Vocabularies = VocabularyInfo[];
436 export interface VocabularyInfo {
437 /**
438 * The name of the vocabulary.
439 */
440 VocabularyName?: VocabularyName;
441 /**
442 * The language code of the vocabulary entries.
443 */
444 LanguageCode?: LanguageCode;
445 /**
446 * The date and time that the vocabulary was last modified.
447 */
448 LastModifiedTime?: DateTime;
449 /**
450 * The processing state of the vocabulary. If the state is READY you can use the vocabulary in a StartTranscriptionJob request.
451 */
452 VocabularyState?: VocabularyState;
453 }
454 export type VocabularyName = string;
455 export type VocabularyState = "PENDING"|"READY"|"FAILED"|string;
456 /**
457 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
458 */
459 export type apiVersion = "2017-10-26"|"latest"|string;
460 export interface ClientApiVersions {
461 /**
462 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
463 */
464 apiVersion?: apiVersion;
465 }
466 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
467 /**
468 * Contains interfaces for use with the TranscribeService client.
469 */
470 export import Types = TranscribeService;
471}
472export = TranscribeService;