aws-sdk-transcribestreamingservice 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/aws-sdk-transcribestreamingservice.rb +49 -0
- data/lib/aws-sdk-transcribestreamingservice/async_client.rb +437 -0
- data/lib/aws-sdk-transcribestreamingservice/client.rb +254 -0
- data/lib/aws-sdk-transcribestreamingservice/client_api.rb +151 -0
- data/lib/aws-sdk-transcribestreamingservice/customizations.rb +0 -0
- data/lib/aws-sdk-transcribestreamingservice/errors.rb +14 -0
- data/lib/aws-sdk-transcribestreamingservice/event_streams.rb +86 -0
- data/lib/aws-sdk-transcribestreamingservice/resource.rb +23 -0
- data/lib/aws-sdk-transcribestreamingservice/types.rb +361 -0
- metadata +90 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws::TranscribeStreamingService
|
9
|
+
class Resource
|
10
|
+
|
11
|
+
# @param options ({})
|
12
|
+
# @option options [Client] :client
|
13
|
+
def initialize(options = {})
|
14
|
+
@client = options[:client] || Client.new(options)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Client]
|
18
|
+
def client
|
19
|
+
@client
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,361 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws::TranscribeStreamingService
|
9
|
+
module Types
|
10
|
+
|
11
|
+
# A list of possible transcriptions for the audio.
|
12
|
+
#
|
13
|
+
# @!attribute [rw] transcript
|
14
|
+
# The text that was transcribed from the audio.
|
15
|
+
# @return [String]
|
16
|
+
#
|
17
|
+
# @!attribute [rw] items
|
18
|
+
# One or more alternative interpretations of the input audio.
|
19
|
+
# @return [Array<Types::Item>]
|
20
|
+
#
|
21
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Alternative AWS API Documentation
|
22
|
+
#
|
23
|
+
class Alternative < Struct.new(
|
24
|
+
:transcript,
|
25
|
+
:items)
|
26
|
+
include Aws::Structure
|
27
|
+
end
|
28
|
+
|
29
|
+
# Provides a wrapper for the audio chunks that you are sending.
|
30
|
+
#
|
31
|
+
# @note When making an API call, you may pass AudioEvent
|
32
|
+
# data as a hash:
|
33
|
+
#
|
34
|
+
# {
|
35
|
+
# audio_chunk: "data",
|
36
|
+
# }
|
37
|
+
#
|
38
|
+
# @!attribute [rw] audio_chunk
|
39
|
+
# An audio blob that contains the next part of the audio that you want
|
40
|
+
# to transcribe.
|
41
|
+
# @return [String]
|
42
|
+
#
|
43
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/AudioEvent AWS API Documentation
|
44
|
+
#
|
45
|
+
class AudioEvent < Struct.new(
|
46
|
+
:audio_chunk,
|
47
|
+
:event_type)
|
48
|
+
include Aws::Structure
|
49
|
+
end
|
50
|
+
|
51
|
+
# One or more arguments to the `StartStreamTranscription` operation was
|
52
|
+
# invalid. For example, `MediaEncoding` was not set to `pcm` or
|
53
|
+
# `LanguageCode` was not set to a valid code. Check the parameters and
|
54
|
+
# try your request again.
|
55
|
+
#
|
56
|
+
# @!attribute [rw] message
|
57
|
+
# @return [String]
|
58
|
+
#
|
59
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/BadRequestException AWS API Documentation
|
60
|
+
#
|
61
|
+
class BadRequestException < Struct.new(
|
62
|
+
:message,
|
63
|
+
:event_type)
|
64
|
+
include Aws::Structure
|
65
|
+
end
|
66
|
+
|
67
|
+
# A new stream started with the same session ID. The current stream has
|
68
|
+
# been terminated.
|
69
|
+
#
|
70
|
+
# @!attribute [rw] message
|
71
|
+
# @return [String]
|
72
|
+
#
|
73
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/ConflictException AWS API Documentation
|
74
|
+
#
|
75
|
+
class ConflictException < Struct.new(
|
76
|
+
:message,
|
77
|
+
:event_type)
|
78
|
+
include Aws::Structure
|
79
|
+
end
|
80
|
+
|
81
|
+
# A problem occurred while processing the audio. Amazon Transcribe
|
82
|
+
# terminated processing. Try your request again.
|
83
|
+
#
|
84
|
+
# @!attribute [rw] message
|
85
|
+
# @return [String]
|
86
|
+
#
|
87
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/InternalFailureException AWS API Documentation
|
88
|
+
#
|
89
|
+
class InternalFailureException < Struct.new(
|
90
|
+
:message,
|
91
|
+
:event_type)
|
92
|
+
include Aws::Structure
|
93
|
+
end
|
94
|
+
|
95
|
+
# A word or phrase transcribed from the input audio.
|
96
|
+
#
|
97
|
+
# @!attribute [rw] start_time
|
98
|
+
# The offset from the beginning of the audio stream to the beginning
|
99
|
+
# of the audio that resulted in the item.
|
100
|
+
# @return [Float]
|
101
|
+
#
|
102
|
+
# @!attribute [rw] end_time
|
103
|
+
# The offset from the beginning of the audio stream to the end of the
|
104
|
+
# audio that resulted in the item.
|
105
|
+
# @return [Float]
|
106
|
+
#
|
107
|
+
# @!attribute [rw] type
|
108
|
+
# The type of the item. `PRONUNCIATION` indicates that the item is a
|
109
|
+
# word that was recognized in the input audio. `PUNCTUATION` indicates
|
110
|
+
# that the item was interpreted as a pause in the input audio.
|
111
|
+
# @return [String]
|
112
|
+
#
|
113
|
+
# @!attribute [rw] content
|
114
|
+
# The word or punctuation that was recognized in the input audio.
|
115
|
+
# @return [String]
|
116
|
+
#
|
117
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Item AWS API Documentation
|
118
|
+
#
|
119
|
+
class Item < Struct.new(
|
120
|
+
:start_time,
|
121
|
+
:end_time,
|
122
|
+
:type,
|
123
|
+
:content)
|
124
|
+
include Aws::Structure
|
125
|
+
end
|
126
|
+
|
127
|
+
# You have exceeded the maximum number of concurrent transcription
|
128
|
+
# streams, are starting transcription streams too quickly, or the
|
129
|
+
# maximum audio length of 4 hours. Wait until a stream has finished
|
130
|
+
# processing, or break your audio stream into smaller chunks and try
|
131
|
+
# your request again.
|
132
|
+
#
|
133
|
+
# @!attribute [rw] message
|
134
|
+
# @return [String]
|
135
|
+
#
|
136
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/LimitExceededException AWS API Documentation
|
137
|
+
#
|
138
|
+
class LimitExceededException < Struct.new(
|
139
|
+
:message,
|
140
|
+
:event_type)
|
141
|
+
include Aws::Structure
|
142
|
+
end
|
143
|
+
|
144
|
+
# The result of transcribing a portion of the input audio stream.
|
145
|
+
#
|
146
|
+
# @!attribute [rw] result_id
|
147
|
+
# A unique identifier for the result.
|
148
|
+
# @return [String]
|
149
|
+
#
|
150
|
+
# @!attribute [rw] start_time
|
151
|
+
# The offset in milliseconds from the beginning of the audio stream to
|
152
|
+
# the beginning of the result.
|
153
|
+
# @return [Float]
|
154
|
+
#
|
155
|
+
# @!attribute [rw] end_time
|
156
|
+
# The offset in milliseconds from the beginning of the audio stream to
|
157
|
+
# the end of the result.
|
158
|
+
# @return [Float]
|
159
|
+
#
|
160
|
+
# @!attribute [rw] is_partial
|
161
|
+
# `true` to indicate that Amazon Transcribe has additional
|
162
|
+
# transcription data to send, `false` to indicate that this is the
|
163
|
+
# last transcription result for the audio stream.
|
164
|
+
# @return [Boolean]
|
165
|
+
#
|
166
|
+
# @!attribute [rw] alternatives
|
167
|
+
# A list of possible transcriptions for the audio. Each alternative
|
168
|
+
# typically contains one `item` that contains the result of the
|
169
|
+
# transcription.
|
170
|
+
# @return [Array<Types::Alternative>]
|
171
|
+
#
|
172
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Result AWS API Documentation
|
173
|
+
#
|
174
|
+
class Result < Struct.new(
|
175
|
+
:result_id,
|
176
|
+
:start_time,
|
177
|
+
:end_time,
|
178
|
+
:is_partial,
|
179
|
+
:alternatives)
|
180
|
+
include Aws::Structure
|
181
|
+
end
|
182
|
+
|
183
|
+
# @note When making an API call, you may pass StartStreamTranscriptionRequest
|
184
|
+
# data as a hash:
|
185
|
+
#
|
186
|
+
# {
|
187
|
+
# language_code: "en-US", # required, accepts en-US, es-US
|
188
|
+
# media_sample_rate_hertz: 1, # required
|
189
|
+
# media_encoding: "pcm", # required, accepts pcm
|
190
|
+
# vocabulary_name: "VocabularyName",
|
191
|
+
# session_id: "SessionId",
|
192
|
+
# input_event_stream_hander: EventStreams::AudioStream.new,
|
193
|
+
# }
|
194
|
+
#
|
195
|
+
# @!attribute [rw] language_code
|
196
|
+
# Indicates the language used in the input audio stream.
|
197
|
+
# @return [String]
|
198
|
+
#
|
199
|
+
# @!attribute [rw] media_sample_rate_hertz
|
200
|
+
# The sample rate, in Hertz, of the input audio. We suggest that you
|
201
|
+
# use 8000 Hz for low quality audio and 16000 Hz for high quality
|
202
|
+
# audio.
|
203
|
+
# @return [Integer]
|
204
|
+
#
|
205
|
+
# @!attribute [rw] media_encoding
|
206
|
+
# The encoding used for the input audio.
|
207
|
+
# @return [String]
|
208
|
+
#
|
209
|
+
# @!attribute [rw] vocabulary_name
|
210
|
+
# The name of the vocabulary to use when processing the transcription
|
211
|
+
# job.
|
212
|
+
# @return [String]
|
213
|
+
#
|
214
|
+
# @!attribute [rw] session_id
|
215
|
+
# A identifier for the transcription session. Use this parameter when
|
216
|
+
# you want to retry a session. If you don't provide a session ID,
|
217
|
+
# Amazon Transcribe will generate one for you and return it in the
|
218
|
+
# response.
|
219
|
+
# @return [String]
|
220
|
+
#
|
221
|
+
# @!attribute [rw] audio_stream
|
222
|
+
# PCM-encoded stream of audio blobs. The audio stream is encoded as an
|
223
|
+
# HTTP2 data frame.
|
224
|
+
# @return [Types::AudioStream]
|
225
|
+
#
|
226
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartStreamTranscriptionRequest AWS API Documentation
|
227
|
+
#
|
228
|
+
class StartStreamTranscriptionRequest < Struct.new(
|
229
|
+
:language_code,
|
230
|
+
:media_sample_rate_hertz,
|
231
|
+
:media_encoding,
|
232
|
+
:vocabulary_name,
|
233
|
+
:session_id,
|
234
|
+
:audio_stream)
|
235
|
+
include Aws::Structure
|
236
|
+
end
|
237
|
+
|
238
|
+
# @!attribute [rw] request_id
|
239
|
+
# An identifier for the streaming transcription.
|
240
|
+
# @return [String]
|
241
|
+
#
|
242
|
+
# @!attribute [rw] language_code
|
243
|
+
# The language code for the input audio stream.
|
244
|
+
# @return [String]
|
245
|
+
#
|
246
|
+
# @!attribute [rw] media_sample_rate_hertz
|
247
|
+
# The sample rate for the input audio stream. Use 8000 Hz for low
|
248
|
+
# quality audio and 16000 Hz for high quality audio.
|
249
|
+
# @return [Integer]
|
250
|
+
#
|
251
|
+
# @!attribute [rw] media_encoding
|
252
|
+
# The encoding used for the input audio stream.
|
253
|
+
# @return [String]
|
254
|
+
#
|
255
|
+
# @!attribute [rw] vocabulary_name
|
256
|
+
# The name of the vocabulary used when processing the job.
|
257
|
+
# @return [String]
|
258
|
+
#
|
259
|
+
# @!attribute [rw] session_id
|
260
|
+
# An identifier for a specific transcription session.
|
261
|
+
# @return [String]
|
262
|
+
#
|
263
|
+
# @!attribute [rw] transcript_result_stream
|
264
|
+
# Represents the stream of transcription events from Amazon Transcribe
|
265
|
+
# to your application.
|
266
|
+
# @return [Types::TranscriptResultStream]
|
267
|
+
#
|
268
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartStreamTranscriptionResponse AWS API Documentation
|
269
|
+
#
|
270
|
+
class StartStreamTranscriptionResponse < Struct.new(
|
271
|
+
:request_id,
|
272
|
+
:language_code,
|
273
|
+
:media_sample_rate_hertz,
|
274
|
+
:media_encoding,
|
275
|
+
:vocabulary_name,
|
276
|
+
:session_id,
|
277
|
+
:transcript_result_stream)
|
278
|
+
include Aws::Structure
|
279
|
+
end
|
280
|
+
|
281
|
+
# The transcription in a TranscriptEvent.
|
282
|
+
#
|
283
|
+
# @!attribute [rw] results
|
284
|
+
# Result objects that contain the results of transcribing a portion of
|
285
|
+
# the input audio stream. The array can be empty.
|
286
|
+
# @return [Array<Types::Result>]
|
287
|
+
#
|
288
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/Transcript AWS API Documentation
|
289
|
+
#
|
290
|
+
class Transcript < Struct.new(
|
291
|
+
:results)
|
292
|
+
include Aws::Structure
|
293
|
+
end
|
294
|
+
|
295
|
+
# Represents a set of transcription results from the server to the
|
296
|
+
# client. It contains one or more segments of the transcription.
|
297
|
+
#
|
298
|
+
# @!attribute [rw] transcript
|
299
|
+
# The transcription of the audio stream. The transcription is composed
|
300
|
+
# of all of the items in the results list.
|
301
|
+
# @return [Types::Transcript]
|
302
|
+
#
|
303
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/TranscriptEvent AWS API Documentation
|
304
|
+
#
|
305
|
+
class TranscriptEvent < Struct.new(
|
306
|
+
:transcript,
|
307
|
+
:event_type)
|
308
|
+
include Aws::Structure
|
309
|
+
end
|
310
|
+
|
311
|
+
# Represents the audio stream from your application to Amazon
|
312
|
+
# Transcribe.
|
313
|
+
#
|
314
|
+
# @note When making an API call, you may pass AudioStream
|
315
|
+
# data as a hash:
|
316
|
+
#
|
317
|
+
# {
|
318
|
+
# audio_event: {
|
319
|
+
# audio_chunk: "data",
|
320
|
+
# },
|
321
|
+
# }
|
322
|
+
#
|
323
|
+
# EventStream is an Enumerator of Events.
|
324
|
+
# #event_types #=> Array, returns all modeled event types in the stream
|
325
|
+
#
|
326
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/AudioStream AWS API Documentation
|
327
|
+
#
|
328
|
+
class AudioStream < Enumerator
|
329
|
+
|
330
|
+
def event_types
|
331
|
+
[
|
332
|
+
:audio_event
|
333
|
+
]
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
337
|
+
|
338
|
+
# Represents the transcription result stream from Amazon Transcribe to
|
339
|
+
# your application.
|
340
|
+
#
|
341
|
+
# EventStream is an Enumerator of Events.
|
342
|
+
# #event_types #=> Array, returns all modeled event types in the stream
|
343
|
+
#
|
344
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/TranscriptResultStream AWS API Documentation
|
345
|
+
#
|
346
|
+
class TranscriptResultStream < Enumerator
|
347
|
+
|
348
|
+
def event_types
|
349
|
+
[
|
350
|
+
:transcript_event,
|
351
|
+
:bad_request_exception,
|
352
|
+
:limit_exceeded_exception,
|
353
|
+
:internal_failure_exception,
|
354
|
+
:conflict_exception
|
355
|
+
]
|
356
|
+
end
|
357
|
+
|
358
|
+
end
|
359
|
+
|
360
|
+
end
|
361
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aws-sdk-transcribestreamingservice
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Amazon Web Services
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aws-sdk-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.48.2
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 3.48.2
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: aws-sigv4
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.1'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.1'
|
47
|
+
description: Official AWS Ruby gem for Amazon Transcribe Streaming Service. This gem
|
48
|
+
is part of the AWS SDK for Ruby.
|
49
|
+
email:
|
50
|
+
- trevrowe@amazon.com
|
51
|
+
executables: []
|
52
|
+
extensions: []
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- lib/aws-sdk-transcribestreamingservice.rb
|
56
|
+
- lib/aws-sdk-transcribestreamingservice/async_client.rb
|
57
|
+
- lib/aws-sdk-transcribestreamingservice/client.rb
|
58
|
+
- lib/aws-sdk-transcribestreamingservice/client_api.rb
|
59
|
+
- lib/aws-sdk-transcribestreamingservice/customizations.rb
|
60
|
+
- lib/aws-sdk-transcribestreamingservice/errors.rb
|
61
|
+
- lib/aws-sdk-transcribestreamingservice/event_streams.rb
|
62
|
+
- lib/aws-sdk-transcribestreamingservice/resource.rb
|
63
|
+
- lib/aws-sdk-transcribestreamingservice/types.rb
|
64
|
+
homepage: http://github.com/aws/aws-sdk-ruby
|
65
|
+
licenses:
|
66
|
+
- Apache-2.0
|
67
|
+
metadata:
|
68
|
+
source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-transcribestreamingservice
|
69
|
+
changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-transcribestreamingservice/CHANGELOG.md
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options: []
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 2.5.2.3
|
87
|
+
signing_key:
|
88
|
+
specification_version: 4
|
89
|
+
summary: AWS SDK for Ruby - Amazon Transcribe Streaming Service
|
90
|
+
test_files: []
|