aws-sdk-transcribestreamingservice 1.73.0 → 1.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-transcribestreamingservice/async_client.rb +263 -1
- data/lib/aws-sdk-transcribestreamingservice/client.rb +55 -1
- data/lib/aws-sdk-transcribestreamingservice/client_api.rb +189 -0
- data/lib/aws-sdk-transcribestreamingservice/endpoint_provider.rb +13 -17
- data/lib/aws-sdk-transcribestreamingservice/errors.rb +16 -0
- data/lib/aws-sdk-transcribestreamingservice/event_streams.rb +231 -6
- data/lib/aws-sdk-transcribestreamingservice/types.rb +797 -2
- data/lib/aws-sdk-transcribestreamingservice.rb +2 -2
- data/sig/client.rbs +29 -0
- data/sig/errors.rbs +3 -0
- data/sig/types.rbs +147 -0
- metadata +2 -2
@@ -16,8 +16,24 @@ module Aws::TranscribeStreamingService
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# @option params [String, StringIO, File] :audio_chunk
|
19
|
-
# An audio blob
|
20
|
-
#
|
19
|
+
# An audio blob containing the next segment of audio from your
|
20
|
+
# application, with a maximum duration of 1 second. The maximum size in
|
21
|
+
# bytes varies based on audio properties.
|
22
|
+
#
|
23
|
+
# Find recommended size in [Transcribing streaming best practices][1].
|
24
|
+
#
|
25
|
+
# Size calculation: `Duration (s) * Sample Rate (Hz) * Number of
|
26
|
+
# Channels * 2 (Bytes per Sample)`
|
27
|
+
#
|
28
|
+
# For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would
|
29
|
+
# be `1 * 16000 * 2 * 2 = 64000 bytes`.
|
30
|
+
#
|
31
|
+
# For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be `1 *
|
32
|
+
# 8000 * 1 * 2 = 16000 bytes`.
|
33
|
+
#
|
34
|
+
#
|
35
|
+
#
|
36
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices
|
21
37
|
#
|
22
38
|
def signal_audio_event_event(params = {})
|
23
39
|
@event_emitter.emit(:audio_event, params)
|
@@ -53,6 +69,124 @@ module Aws::TranscribeStreamingService
|
|
53
69
|
|
54
70
|
end
|
55
71
|
|
72
|
+
class MedicalScribeInputStream
|
73
|
+
|
74
|
+
def initialize
|
75
|
+
@event_emitter = Aws::EventEmitter.new
|
76
|
+
end
|
77
|
+
|
78
|
+
# @option params [String, StringIO, File] :audio_chunk
|
79
|
+
# An audio blob containing the next segment of audio from your
|
80
|
+
# application, with a maximum duration of 1 second. The maximum size in
|
81
|
+
# bytes varies based on audio properties.
|
82
|
+
#
|
83
|
+
# Find recommended size in [Transcribing streaming best practices][1].
|
84
|
+
#
|
85
|
+
# Size calculation: `Duration (s) * Sample Rate (Hz) * Number of
|
86
|
+
# Channels * 2 (Bytes per Sample)`
|
87
|
+
#
|
88
|
+
# For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would
|
89
|
+
# be `1 * 16000 * 2 * 2 = 64000 bytes`.
|
90
|
+
#
|
91
|
+
# For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be `1 *
|
92
|
+
# 8000 * 1 * 2 = 16000 bytes`.
|
93
|
+
#
|
94
|
+
#
|
95
|
+
#
|
96
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices
|
97
|
+
#
|
98
|
+
def signal_audio_event_event(params = {})
|
99
|
+
@event_emitter.emit(:audio_event, params)
|
100
|
+
end
|
101
|
+
|
102
|
+
# @option params [String] :type
|
103
|
+
# The type of `MedicalScribeSessionControlEvent`.
|
104
|
+
#
|
105
|
+
# Possible Values:
|
106
|
+
#
|
107
|
+
# * `END_OF_SESSION` - Indicates the audio streaming is complete. After
|
108
|
+
# you send an END\_OF\_SESSION event, Amazon Web Services HealthScribe
|
109
|
+
# starts the post-stream analytics. The session can't be resumed
|
110
|
+
# after this event is sent. After Amazon Web Services HealthScribe
|
111
|
+
# processes the event, the real-time `StreamStatus` is `COMPLETED`.
|
112
|
+
# You get the `StreamStatus` and other stream details with the
|
113
|
+
# [GetMedicalScribeStream][1] API operation. For more information
|
114
|
+
# about different streaming statuses, see the `StreamStatus`
|
115
|
+
# description in the [MedicalScribeStreamDetails][2].
|
116
|
+
#
|
117
|
+
# ^
|
118
|
+
#
|
119
|
+
#
|
120
|
+
#
|
121
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_GetMedicalScribeStream.html
|
122
|
+
# [2]: https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_MedicalScribeStreamDetails.html
|
123
|
+
#
|
124
|
+
def signal_session_control_event_event(params = {})
|
125
|
+
@event_emitter.emit(:session_control_event, params)
|
126
|
+
end
|
127
|
+
|
128
|
+
# @option params [String] :vocabulary_name
|
129
|
+
# Specify the name of the custom vocabulary you want to use for your
|
130
|
+
# streaming session. Custom vocabulary names are case-sensitive.
|
131
|
+
#
|
132
|
+
# @option params [String] :vocabulary_filter_name
|
133
|
+
# Specify the name of the custom vocabulary filter you want to include
|
134
|
+
# in your streaming session. Custom vocabulary filter names are
|
135
|
+
# case-sensitive.
|
136
|
+
#
|
137
|
+
# If you include `VocabularyFilterName` in the
|
138
|
+
# `MedicalScribeConfigurationEvent`, you must also include
|
139
|
+
# `VocabularyFilterMethod`.
|
140
|
+
#
|
141
|
+
# @option params [String] :vocabulary_filter_method
|
142
|
+
# Specify how you want your custom vocabulary filter applied to the
|
143
|
+
# streaming session.
|
144
|
+
#
|
145
|
+
# To replace words with `***`, specify `mask`.
|
146
|
+
#
|
147
|
+
# To delete words, specify `remove`.
|
148
|
+
#
|
149
|
+
# To flag words without changing them, specify `tag`.
|
150
|
+
#
|
151
|
+
# @option params [String] :resource_access_role_arn
|
152
|
+
# The Amazon Resource Name (ARN) of an IAM role that has permissions to
|
153
|
+
# access the Amazon S3 output bucket you specified, and use your KMS key
|
154
|
+
# if supplied. If the role that you specify doesn’t have the appropriate
|
155
|
+
# permissions, your request fails.
|
156
|
+
#
|
157
|
+
# IAM role ARNs have the format
|
158
|
+
# `arn:partition:iam::account:role/role-name-with-path`. For example:
|
159
|
+
# `arn:aws:iam::111122223333:role/Admin`.
|
160
|
+
#
|
161
|
+
# For more information, see [Amazon Web Services HealthScribe][1].
|
162
|
+
#
|
163
|
+
#
|
164
|
+
#
|
165
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-streaming.html
|
166
|
+
#
|
167
|
+
# @option params [Array<Types::MedicalScribeChannelDefinition>] :channel_definitions
|
168
|
+
# Specify which speaker is on which audio channel.
|
169
|
+
#
|
170
|
+
# @option params [Types::MedicalScribeEncryptionSettings] :encryption_settings
|
171
|
+
# Specify the encryption settings for your streaming session.
|
172
|
+
#
|
173
|
+
# @option params [Types::MedicalScribePostStreamAnalyticsSettings] :post_stream_analytics_settings
|
174
|
+
# Specify settings for post-stream analytics.
|
175
|
+
#
|
176
|
+
def signal_configuration_event_event(params = {})
|
177
|
+
@event_emitter.emit(:configuration_event, params)
|
178
|
+
end
|
179
|
+
|
180
|
+
def signal_end_stream
|
181
|
+
@event_emitter.emit(:end_stream, {})
|
182
|
+
end
|
183
|
+
|
184
|
+
# @api private
|
185
|
+
# @return Aws::EventEmitter
|
186
|
+
attr_reader :event_emitter
|
187
|
+
|
188
|
+
end
|
189
|
+
|
56
190
|
class AudioStream
|
57
191
|
|
58
192
|
def initialize
|
@@ -60,8 +194,24 @@ module Aws::TranscribeStreamingService
|
|
60
194
|
end
|
61
195
|
|
62
196
|
# @option params [String, StringIO, File] :audio_chunk
|
63
|
-
# An audio blob
|
64
|
-
#
|
197
|
+
# An audio blob containing the next segment of audio from your
|
198
|
+
# application, with a maximum duration of 1 second. The maximum size in
|
199
|
+
# bytes varies based on audio properties.
|
200
|
+
#
|
201
|
+
# Find recommended size in [Transcribing streaming best practices][1].
|
202
|
+
#
|
203
|
+
# Size calculation: `Duration (s) * Sample Rate (Hz) * Number of
|
204
|
+
# Channels * 2 (Bytes per Sample)`
|
205
|
+
#
|
206
|
+
# For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would
|
207
|
+
# be `1 * 16000 * 2 * 2 = 64000 bytes`.
|
208
|
+
#
|
209
|
+
# For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be `1 *
|
210
|
+
# 8000 * 1 * 2 = 16000 bytes`.
|
211
|
+
#
|
212
|
+
#
|
213
|
+
#
|
214
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices
|
65
215
|
#
|
66
216
|
def signal_audio_event_event(params = {})
|
67
217
|
@event_emitter.emit(:audio_event, params)
|
@@ -104,8 +254,24 @@ module Aws::TranscribeStreamingService
|
|
104
254
|
end
|
105
255
|
|
106
256
|
# @option params [String, StringIO, File] :audio_chunk
|
107
|
-
# An audio blob
|
108
|
-
#
|
257
|
+
# An audio blob containing the next segment of audio from your
|
258
|
+
# application, with a maximum duration of 1 second. The maximum size in
|
259
|
+
# bytes varies based on audio properties.
|
260
|
+
#
|
261
|
+
# Find recommended size in [Transcribing streaming best practices][1].
|
262
|
+
#
|
263
|
+
# Size calculation: `Duration (s) * Sample Rate (Hz) * Number of
|
264
|
+
# Channels * 2 (Bytes per Sample)`
|
265
|
+
#
|
266
|
+
# For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would
|
267
|
+
# be `1 * 16000 * 2 * 2 = 64000 bytes`.
|
268
|
+
#
|
269
|
+
# For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be `1 *
|
270
|
+
# 8000 * 1 * 2 = 16000 bytes`.
|
271
|
+
#
|
272
|
+
#
|
273
|
+
#
|
274
|
+
# [1]: https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices
|
109
275
|
#
|
110
276
|
def signal_audio_event_event(params = {})
|
111
277
|
@event_emitter.emit(:audio_event, params)
|
@@ -204,6 +370,65 @@ module Aws::TranscribeStreamingService
|
|
204
370
|
# @return Aws::EventEmitter
|
205
371
|
attr_reader :event_emitter
|
206
372
|
|
373
|
+
end
|
374
|
+
class MedicalScribeResultStream
|
375
|
+
|
376
|
+
def initialize
|
377
|
+
@event_emitter = Aws::EventEmitter.new
|
378
|
+
end
|
379
|
+
|
380
|
+
def on_transcript_event_event(&block)
|
381
|
+
@event_emitter.on(:transcript_event, block) if block_given?
|
382
|
+
end
|
383
|
+
|
384
|
+
def on_bad_request_exception_event(&block)
|
385
|
+
@event_emitter.on(:bad_request_exception, block) if block_given?
|
386
|
+
end
|
387
|
+
|
388
|
+
def on_limit_exceeded_exception_event(&block)
|
389
|
+
@event_emitter.on(:limit_exceeded_exception, block) if block_given?
|
390
|
+
end
|
391
|
+
|
392
|
+
def on_internal_failure_exception_event(&block)
|
393
|
+
@event_emitter.on(:internal_failure_exception, block) if block_given?
|
394
|
+
end
|
395
|
+
|
396
|
+
def on_conflict_exception_event(&block)
|
397
|
+
@event_emitter.on(:conflict_exception, block) if block_given?
|
398
|
+
end
|
399
|
+
|
400
|
+
def on_service_unavailable_exception_event(&block)
|
401
|
+
@event_emitter.on(:service_unavailable_exception, block) if block_given?
|
402
|
+
end
|
403
|
+
|
404
|
+
def on_error_event(&block)
|
405
|
+
@event_emitter.on(:error, block) if block_given?
|
406
|
+
end
|
407
|
+
|
408
|
+
def on_initial_response_event(&block)
|
409
|
+
@event_emitter.on(:initial_response, block) if block_given?
|
410
|
+
end
|
411
|
+
|
412
|
+
def on_unknown_event(&block)
|
413
|
+
@event_emitter.on(:unknown_event, block) if block_given?
|
414
|
+
end
|
415
|
+
|
416
|
+
def on_event(&block)
|
417
|
+
on_transcript_event_event(&block)
|
418
|
+
on_bad_request_exception_event(&block)
|
419
|
+
on_limit_exceeded_exception_event(&block)
|
420
|
+
on_internal_failure_exception_event(&block)
|
421
|
+
on_conflict_exception_event(&block)
|
422
|
+
on_service_unavailable_exception_event(&block)
|
423
|
+
on_error_event(&block)
|
424
|
+
on_initial_response_event(&block)
|
425
|
+
on_unknown_event(&block)
|
426
|
+
end
|
427
|
+
|
428
|
+
# @api private
|
429
|
+
# @return Aws::EventEmitter
|
430
|
+
attr_reader :event_emitter
|
431
|
+
|
207
432
|
end
|
208
433
|
class MedicalTranscriptResultStream
|
209
434
|
|