aws-sdk-transcribestreamingservice 1.23.0 → 1.24.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a20677881e3bfb3a3b6c5bfd8a67b149867bbead6c0a60e9ddf84ffbbd120708
4
- data.tar.gz: 97e88c82f7147e1053c0fedb5603310d4edd0bd87b364636a5dd8ba4f09a1771
3
+ metadata.gz: 728ef1d0f1267f59a84f2f623af1875963689aadea2090675656dac21e9ac71b
4
+ data.tar.gz: 62eeffcdb268c681bd31ff1d9ba171b127922956c4b6e1e4c3684c5d36169c41
5
5
  SHA512:
6
- metadata.gz: f10f1f7cab618e0e622f24f5202ca40c629d13ccd7975205eeb88f414fd8da713037b4a5246d236fe4125980beca7112f5ae494d2aee867fddad0b9c82028a29
7
- data.tar.gz: d4fb5c51f036330585abd36eb4c8ee66616fd1c9298b68e0e40d53adcdbd9e8c4ad6076bbd2009791f73ba22e6c1efa3cc84aec44fa4d2a545c6519b7ee1b2fd
6
+ metadata.gz: 3d6679ae7783a568fc94d632999e9956a107de2d041f322e166995c6a18223c33aa2d5893461e750a4d68acbf1d8630569bb5fa040c11eb3c7bc46de37297ef2
7
+ data.tar.gz: 4ba8a7960984cc65c2b9b4c380b10b874b81caca9faa716bbc7da0f6cf7a296aa6bacc787a58184d9095640d1646a80cbdf2c5d880247c8fb1694bec0f4f4336
@@ -30,7 +30,7 @@ require_relative 'aws-sdk-transcribestreamingservice/event_streams'
30
30
  # structure.
31
31
  #
32
32
  # transcribe_streaming_service = Aws::TranscribeStreamingService::Client.new
33
- # resp = transcribe_streaming_service.start_stream_transcription(params)
33
+ # resp = transcribe_streaming_service.start_medical_stream_transcription(params)
34
34
  #
35
35
  # See {Client} for more information.
36
36
  #
@@ -50,6 +50,6 @@ require_relative 'aws-sdk-transcribestreamingservice/event_streams'
50
50
  # @!group service
51
51
  module Aws::TranscribeStreamingService
52
52
 
53
- GEM_VERSION = '1.23.0'
53
+ GEM_VERSION = '1.24.0'
54
54
 
55
55
  end
@@ -237,6 +237,263 @@ module Aws::TranscribeStreamingService
237
237
 
238
238
  # @!group API Operations
239
239
 
240
+ # Starts a bidirectional HTTP/2 stream where audio is streamed to Amazon
241
+ # Transcribe Medical and the transcription results are streamed to your
242
+ # application.
243
+ #
244
+ # @option params [required, String] :language_code
245
+ # Indicates the source language used in the input audio stream. For
246
+ # Amazon Transcribe Medical, this is US English (en-US).
247
+ #
248
+ # @option params [required, Integer] :media_sample_rate_hertz
249
+ # The sample rate of the input audio in Hertz. Sample rates of 16000 Hz
250
+ # or higher are accepted.
251
+ #
252
+ # @option params [required, String] :media_encoding
253
+ # The encoding used for the input audio.
254
+ #
255
+ # @option params [String] :vocabulary_name
256
+ # The name of the medical custom vocabulary to use when processing the
257
+ # real-time stream.
258
+ #
259
+ # @option params [required, String] :specialty
260
+ # The medical specialty of the clinician or provider.
261
+ #
262
+ # @option params [required, String] :type
263
+ # The type of input audio. Choose `DICTATION` for a provider dictating
264
+ # patient notes. Choose `CONVERSATION` for a dialogue between a patient
265
+ # and one or more medical professionanls.
266
+ #
267
+ # @option params [Boolean] :show_speaker_label
268
+ # When `true`, enables speaker identification in your real-time stream.
269
+ #
270
+ # @option params [String] :session_id
271
+ # Optional. An identifier for the transcription session. If you don't
272
+ # provide a session ID, Amazon Transcribe generates one for you and
273
+ # returns it in the response.
274
+ #
275
+ # @option params [Boolean] :enable_channel_identification
276
+ # When `true`, instructs Amazon Transcribe Medical to process each audio
277
+ # channel separately and then merge the transcription output of each
278
+ # channel into a single transcription.
279
+ #
280
+ # Amazon Transcribe Medical also produces a transcription of each item.
281
+ # An item includes the start time, end time, and any alternative
282
+ # transcriptions.
283
+ #
284
+ # You can't set both `ShowSpeakerLabel` and
285
+ # `EnableChannelIdentification` in the same request. If you set both,
286
+ # your request returns a `BadRequestException`.
287
+ #
288
+ # @option params [Integer] :number_of_channels
289
+ # The number of channels that are in your audio stream.
290
+ #
291
+ # @return [Types::StartMedicalStreamTranscriptionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
292
+ #
293
+ # * {Types::StartMedicalStreamTranscriptionResponse#request_id #request_id} => String
294
+ # * {Types::StartMedicalStreamTranscriptionResponse#language_code #language_code} => String
295
+ # * {Types::StartMedicalStreamTranscriptionResponse#media_sample_rate_hertz #media_sample_rate_hertz} => Integer
296
+ # * {Types::StartMedicalStreamTranscriptionResponse#media_encoding #media_encoding} => String
297
+ # * {Types::StartMedicalStreamTranscriptionResponse#vocabulary_name #vocabulary_name} => String
298
+ # * {Types::StartMedicalStreamTranscriptionResponse#specialty #specialty} => String
299
+ # * {Types::StartMedicalStreamTranscriptionResponse#type #type} => String
300
+ # * {Types::StartMedicalStreamTranscriptionResponse#show_speaker_label #show_speaker_label} => Boolean
301
+ # * {Types::StartMedicalStreamTranscriptionResponse#session_id #session_id} => String
302
+ # * {Types::StartMedicalStreamTranscriptionResponse#transcript_result_stream #transcript_result_stream} => Types::MedicalTranscriptResultStream
303
+ # * {Types::StartMedicalStreamTranscriptionResponse#enable_channel_identification #enable_channel_identification} => Boolean
304
+ # * {Types::StartMedicalStreamTranscriptionResponse#number_of_channels #number_of_channels} => Integer
305
+ #
306
+ # @example Bi-directional EventStream Operation Example
307
+ #
308
+ # You can signal input events after initial request is
309
+ # established, events will be sent to stream
310
+ # immediately (once stream connection is established successfully).
311
+ #
312
+ # To signal events, you can call #signal methods from an Aws::TranscribeStreamingService::EventStreams::AudioStream object.
313
+ # Make sure signal events before calling #wait or #join! at async response.
314
+ #
315
+ # input_stream = Aws::TranscribeStreamingService::EventStreams::AudioStream.new
316
+ #
317
+ # async_resp = client.start_medical_stream_transcription( # params input,
318
+ # input_event_stream_handler: input_stream) do |out_stream|
319
+ #
320
+ # # register callbacks for events arrival
321
+ # out_stream.on_transcript_event_event do |event|
322
+ # event # => Aws::TranscribeStreamingService::Types::TranscriptEvent
323
+ # end
324
+ # out_stream.on_bad_request_exception_event do |event|
325
+ # event # => Aws::TranscribeStreamingService::Types::BadRequestException
326
+ # end
327
+ # out_stream.on_limit_exceeded_exception_event do |event|
328
+ # event # => Aws::TranscribeStreamingService::Types::LimitExceededException
329
+ # end
330
+ # out_stream.on_internal_failure_exception_event do |event|
331
+ # event # => Aws::TranscribeStreamingService::Types::InternalFailureException
332
+ # end
333
+ # out_stream.on_conflict_exception_event do |event|
334
+ # event # => Aws::TranscribeStreamingService::Types::ConflictException
335
+ # end
336
+ # out_stream.on_service_unavailable_exception_event do |event|
337
+ # event # => Aws::TranscribeStreamingService::Types::ServiceUnavailableException
338
+ # end
339
+ #
340
+ # end
341
+ # # => returns Aws::Seahorse::Client::AsyncResponse
342
+ #
343
+ # # signal events
344
+ # input_stream.signal_audio_event_event( ... )
345
+ #
346
+ # # make sure signaling :end_stream in the end
347
+ # input_stream.signal_end_stream
348
+ #
349
+ # # wait until stream is closed before finalizing sync response
350
+ # resp = async_resp.wait
351
+ # # Or close stream and finalizing sync response immediately
352
+ # # resp = async_resp.join!
353
+ #
354
+ # Inorder to streamingly processing events received, you can also provide an Aws::TranscribeStreamingService::EventStreams::MedicalTranscriptResultStream
355
+ # object to register callbacks before initializing request instead of processing from request block
356
+ #
357
+ # output_stream = Aws::TranscribeStreamingService::EventStreams::MedicalTranscriptResultStream.new
358
+ # # register callbacks for events arrival
359
+ # output_stream.on_transcript_event_event do |event|
360
+ # event # => Aws::TranscribeStreamingService::Types::TranscriptEvent
361
+ # end
362
+ # output_stream.on_bad_request_exception_event do |event|
363
+ # event # => Aws::TranscribeStreamingService::Types::BadRequestException
364
+ # end
365
+ # output_stream.on_limit_exceeded_exception_event do |event|
366
+ # event # => Aws::TranscribeStreamingService::Types::LimitExceededException
367
+ # end
368
+ # output_stream.on_internal_failure_exception_event do |event|
369
+ # event # => Aws::TranscribeStreamingService::Types::InternalFailureException
370
+ # end
371
+ # output_stream.on_conflict_exception_event do |event|
372
+ # event # => Aws::TranscribeStreamingService::Types::ConflictException
373
+ # end
374
+ # output_stream.on_service_unavailable_exception_event do |event|
375
+ # event # => Aws::TranscribeStreamingService::Types::ServiceUnavailableException
376
+ # end
377
+ # output_stream.on_error_event do |event|
378
+ # # catch unmodeled error event in the stream
379
+ # raise event
380
+ # # => Aws::Errors::EventError
381
+ # # event.event_type => :error
382
+ # # event.error_code => String
383
+ # # event.error_message => String
384
+ # end
385
+ #
386
+ # async_resp = client.start_medical_stream_transcription ( #params input,
387
+ # input_event_stream_handler: input_stream
388
+ # output_event_stream_handler: output_stream
389
+ # )
390
+ #
391
+ # resp = async_resp.wait!
392
+ #
393
+ # Besides above usage patterns for process events when they arrive immediately, you can also
394
+ # iterate through events after response complete.
395
+ #
396
+ # Events are available at resp.transcript_result_stream # => Enumerator
397
+ #
398
+ # @example Request syntax with placeholder values
399
+ #
400
+ # async_resp = async_client.start_medical_stream_transcription({
401
+ # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE, pt-BR, ja-JP, ko-KR
402
+ # media_sample_rate_hertz: 1, # required
403
+ # media_encoding: "pcm", # required, accepts pcm, ogg-opus, flac
404
+ # vocabulary_name: "VocabularyName",
405
+ # specialty: "PRIMARYCARE", # required, accepts PRIMARYCARE, CARDIOLOGY, NEUROLOGY, ONCOLOGY, RADIOLOGY, UROLOGY
406
+ # type: "CONVERSATION", # required, accepts CONVERSATION, DICTATION
407
+ # show_speaker_label: false,
408
+ # session_id: "SessionId",
409
+ # input_event_stream_hander: EventStreams::AudioStream.new,
410
+ # enable_channel_identification: false,
411
+ # number_of_channels: 1,
412
+ # })
413
+ # # => Seahorse::Client::AsyncResponse
414
+ # async_resp.wait
415
+ # # => Seahorse::Client::Response
416
+ # # Or use async_resp.join!
417
+ #
418
+ # @example Response structure
419
+ #
420
+ # resp.request_id #=> String
421
+ # resp.language_code #=> String, one of "en-US", "en-GB", "es-US", "fr-CA", "fr-FR", "en-AU", "it-IT", "de-DE", "pt-BR", "ja-JP", "ko-KR"
422
+ # resp.media_sample_rate_hertz #=> Integer
423
+ # resp.media_encoding #=> String, one of "pcm", "ogg-opus", "flac"
424
+ # resp.vocabulary_name #=> String
425
+ # resp.specialty #=> String, one of "PRIMARYCARE", "CARDIOLOGY", "NEUROLOGY", "ONCOLOGY", "RADIOLOGY", "UROLOGY"
426
+ # resp.type #=> String, one of "CONVERSATION", "DICTATION"
427
+ # resp.show_speaker_label #=> Boolean
428
+ # resp.session_id #=> String
429
+ # All events are available at resp.transcript_result_stream:
430
+ # resp.transcript_result_stream #=> Enumerator
431
+ # resp.transcript_result_stream.event_types #=> [:transcript_event, :bad_request_exception, :limit_exceeded_exception, :internal_failure_exception, :conflict_exception, :service_unavailable_exception]
432
+ #
433
+ # For :transcript_event event available at #on_transcript_event_event callback and response eventstream enumerator:
434
+ # event.transcript.results #=> Array
435
+ # event.transcript.results[0].result_id #=> String
436
+ # event.transcript.results[0].start_time #=> Float
437
+ # event.transcript.results[0].end_time #=> Float
438
+ # event.transcript.results[0].is_partial #=> Boolean
439
+ # event.transcript.results[0].alternatives #=> Array
440
+ # event.transcript.results[0].alternatives[0].transcript #=> String
441
+ # event.transcript.results[0].alternatives[0].items #=> Array
442
+ # event.transcript.results[0].alternatives[0].items[0].start_time #=> Float
443
+ # event.transcript.results[0].alternatives[0].items[0].end_time #=> Float
444
+ # event.transcript.results[0].alternatives[0].items[0].type #=> String, one of "pronunciation", "punctuation"
445
+ # event.transcript.results[0].alternatives[0].items[0].content #=> String
446
+ # event.transcript.results[0].alternatives[0].items[0].confidence #=> Float
447
+ # event.transcript.results[0].alternatives[0].items[0].speaker #=> String
448
+ # event.transcript.results[0].channel_id #=> String
449
+ #
450
+ # For :bad_request_exception event available at #on_bad_request_exception_event callback and response eventstream enumerator:
451
+ # event.message #=> String
452
+ #
453
+ # For :limit_exceeded_exception event available at #on_limit_exceeded_exception_event callback and response eventstream enumerator:
454
+ # event.message #=> String
455
+ #
456
+ # For :internal_failure_exception event available at #on_internal_failure_exception_event callback and response eventstream enumerator:
457
+ # event.message #=> String
458
+ #
459
+ # For :conflict_exception event available at #on_conflict_exception_event callback and response eventstream enumerator:
460
+ # event.message #=> String
461
+ #
462
+ # For :service_unavailable_exception event available at #on_service_unavailable_exception_event callback and response eventstream enumerator:
463
+ # event.message #=> String
464
+ #
465
+ # resp.enable_channel_identification #=> Boolean
466
+ # resp.number_of_channels #=> Integer
467
+ #
468
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartMedicalStreamTranscription AWS API Documentation
469
+ #
470
+ # @overload start_medical_stream_transcription(params = {})
471
+ # @param [Hash] params ({})
472
+ def start_medical_stream_transcription(params = {}, options = {}, &block)
473
+ params = params.dup
474
+ input_event_stream_handler = _event_stream_handler(
475
+ :input,
476
+ params.delete(:input_event_stream_handler),
477
+ EventStreams::AudioStream
478
+ )
479
+ output_event_stream_handler = _event_stream_handler(
480
+ :output,
481
+ params.delete(:output_event_stream_handler) || params.delete(:event_stream_handler),
482
+ EventStreams::MedicalTranscriptResultStream
483
+ )
484
+
485
+ yield(output_event_stream_handler) if block_given?
486
+
487
+ req = build_request(:start_medical_stream_transcription, params)
488
+
489
+ req.context[:input_event_stream_handler] = input_event_stream_handler
490
+ req.handlers.add(Aws::Binary::EncodeHandler, priority: 95)
491
+ req.context[:output_event_stream_handler] = output_event_stream_handler
492
+ req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
493
+
494
+ req.send_request(options, &block)
495
+ end
496
+
240
497
  # Starts a bidirectional HTTP2 stream where audio is streamed to Amazon
241
498
  # Transcribe and the transcription results are streamed to your
242
499
  # application.
@@ -259,7 +516,7 @@ module Aws::TranscribeStreamingService
259
516
  # 8000 Hz for low quality audio and 16000 Hz for high quality audio.
260
517
  #
261
518
  # @option params [required, String] :media_encoding
262
- # The encoding used for the input audio. `pcm` is the only valid value.
519
+ # The encoding used for the input audio.
263
520
  #
264
521
  # @option params [String] :vocabulary_name
265
522
  # The name of the vocabulary to use when processing the transcription
@@ -412,9 +669,9 @@ module Aws::TranscribeStreamingService
412
669
  # @example Request syntax with placeholder values
413
670
  #
414
671
  # async_resp = async_client.start_stream_transcription({
415
- # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE
672
+ # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE, pt-BR, ja-JP, ko-KR
416
673
  # media_sample_rate_hertz: 1, # required
417
- # media_encoding: "pcm", # required, accepts pcm
674
+ # media_encoding: "pcm", # required, accepts pcm, ogg-opus, flac
418
675
  # vocabulary_name: "VocabularyName",
419
676
  # session_id: "SessionId",
420
677
  # input_event_stream_hander: EventStreams::AudioStream.new,
@@ -432,9 +689,9 @@ module Aws::TranscribeStreamingService
432
689
  # @example Response structure
433
690
  #
434
691
  # resp.request_id #=> String
435
- # resp.language_code #=> String, one of "en-US", "en-GB", "es-US", "fr-CA", "fr-FR", "en-AU", "it-IT", "de-DE"
692
+ # resp.language_code #=> String, one of "en-US", "en-GB", "es-US", "fr-CA", "fr-FR", "en-AU", "it-IT", "de-DE", "pt-BR", "ja-JP", "ko-KR"
436
693
  # resp.media_sample_rate_hertz #=> Integer
437
- # resp.media_encoding #=> String, one of "pcm"
694
+ # resp.media_encoding #=> String, one of "pcm", "ogg-opus", "flac"
438
695
  # resp.vocabulary_name #=> String
439
696
  # resp.session_id #=> String
440
697
  # All events are available at resp.transcript_result_stream:
@@ -522,7 +779,7 @@ module Aws::TranscribeStreamingService
522
779
  http_response: Seahorse::Client::Http::AsyncResponse.new,
523
780
  config: config)
524
781
  context[:gem_name] = 'aws-sdk-transcribestreamingservice'
525
- context[:gem_version] = '1.23.0'
782
+ context[:gem_version] = '1.24.0'
526
783
  Seahorse::Client::Request.new(handlers, context)
527
784
  end
528
785
 
@@ -351,7 +351,7 @@ module Aws::TranscribeStreamingService
351
351
  params: params,
352
352
  config: config)
353
353
  context[:gem_name] = 'aws-sdk-transcribestreamingservice'
354
- context[:gem_version] = '1.23.0'
354
+ context[:gem_version] = '1.24.0'
355
355
  Seahorse::Client::Request.new(handlers, context)
356
356
  end
357
357
 
@@ -20,6 +20,7 @@ module Aws::TranscribeStreamingService
20
20
  AudioStream = Shapes::StructureShape.new(name: 'AudioStream')
21
21
  BadRequestException = Shapes::StructureShape.new(name: 'BadRequestException')
22
22
  Boolean = Shapes::BooleanShape.new(name: 'Boolean')
23
+ Confidence = Shapes::FloatShape.new(name: 'Confidence')
23
24
  ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
24
25
  Double = Shapes::FloatShape.new(name: 'Double')
25
26
  InternalFailureException = Shapes::StructureShape.new(name: 'InternalFailureException')
@@ -30,18 +31,31 @@ module Aws::TranscribeStreamingService
30
31
  LimitExceededException = Shapes::StructureShape.new(name: 'LimitExceededException')
31
32
  MediaEncoding = Shapes::StringShape.new(name: 'MediaEncoding')
32
33
  MediaSampleRateHertz = Shapes::IntegerShape.new(name: 'MediaSampleRateHertz')
34
+ MedicalAlternative = Shapes::StructureShape.new(name: 'MedicalAlternative')
35
+ MedicalAlternativeList = Shapes::ListShape.new(name: 'MedicalAlternativeList')
36
+ MedicalItem = Shapes::StructureShape.new(name: 'MedicalItem')
37
+ MedicalItemList = Shapes::ListShape.new(name: 'MedicalItemList')
38
+ MedicalResult = Shapes::StructureShape.new(name: 'MedicalResult')
39
+ MedicalResultList = Shapes::ListShape.new(name: 'MedicalResultList')
40
+ MedicalTranscript = Shapes::StructureShape.new(name: 'MedicalTranscript')
41
+ MedicalTranscriptEvent = Shapes::StructureShape.new(name: 'MedicalTranscriptEvent')
42
+ MedicalTranscriptResultStream = Shapes::StructureShape.new(name: 'MedicalTranscriptResultStream')
33
43
  NumberOfChannels = Shapes::IntegerShape.new(name: 'NumberOfChannels')
34
44
  RequestId = Shapes::StringShape.new(name: 'RequestId')
35
45
  Result = Shapes::StructureShape.new(name: 'Result')
36
46
  ResultList = Shapes::ListShape.new(name: 'ResultList')
37
47
  ServiceUnavailableException = Shapes::StructureShape.new(name: 'ServiceUnavailableException')
38
48
  SessionId = Shapes::StringShape.new(name: 'SessionId')
49
+ Specialty = Shapes::StringShape.new(name: 'Specialty')
50
+ StartMedicalStreamTranscriptionRequest = Shapes::StructureShape.new(name: 'StartMedicalStreamTranscriptionRequest')
51
+ StartMedicalStreamTranscriptionResponse = Shapes::StructureShape.new(name: 'StartMedicalStreamTranscriptionResponse')
39
52
  StartStreamTranscriptionRequest = Shapes::StructureShape.new(name: 'StartStreamTranscriptionRequest')
40
53
  StartStreamTranscriptionResponse = Shapes::StructureShape.new(name: 'StartStreamTranscriptionResponse')
41
54
  String = Shapes::StringShape.new(name: 'String')
42
55
  Transcript = Shapes::StructureShape.new(name: 'Transcript')
43
56
  TranscriptEvent = Shapes::StructureShape.new(name: 'TranscriptEvent')
44
57
  TranscriptResultStream = Shapes::StructureShape.new(name: 'TranscriptResultStream')
58
+ Type = Shapes::StringShape.new(name: 'Type')
45
59
  VocabularyFilterMethod = Shapes::StringShape.new(name: 'VocabularyFilterMethod')
46
60
  VocabularyFilterName = Shapes::StringShape.new(name: 'VocabularyFilterName')
47
61
  VocabularyName = Shapes::StringShape.new(name: 'VocabularyName')
@@ -80,6 +94,46 @@ module Aws::TranscribeStreamingService
80
94
  LimitExceededException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
81
95
  LimitExceededException.struct_class = Types::LimitExceededException
82
96
 
97
+ MedicalAlternative.add_member(:transcript, Shapes::ShapeRef.new(shape: String, location_name: "Transcript"))
98
+ MedicalAlternative.add_member(:items, Shapes::ShapeRef.new(shape: MedicalItemList, location_name: "Items"))
99
+ MedicalAlternative.struct_class = Types::MedicalAlternative
100
+
101
+ MedicalAlternativeList.member = Shapes::ShapeRef.new(shape: MedicalAlternative)
102
+
103
+ MedicalItem.add_member(:start_time, Shapes::ShapeRef.new(shape: Double, location_name: "StartTime"))
104
+ MedicalItem.add_member(:end_time, Shapes::ShapeRef.new(shape: Double, location_name: "EndTime"))
105
+ MedicalItem.add_member(:type, Shapes::ShapeRef.new(shape: ItemType, location_name: "Type"))
106
+ MedicalItem.add_member(:content, Shapes::ShapeRef.new(shape: String, location_name: "Content"))
107
+ MedicalItem.add_member(:confidence, Shapes::ShapeRef.new(shape: Confidence, location_name: "Confidence"))
108
+ MedicalItem.add_member(:speaker, Shapes::ShapeRef.new(shape: String, location_name: "Speaker"))
109
+ MedicalItem.struct_class = Types::MedicalItem
110
+
111
+ MedicalItemList.member = Shapes::ShapeRef.new(shape: MedicalItem)
112
+
113
+ MedicalResult.add_member(:result_id, Shapes::ShapeRef.new(shape: String, location_name: "ResultId"))
114
+ MedicalResult.add_member(:start_time, Shapes::ShapeRef.new(shape: Double, location_name: "StartTime"))
115
+ MedicalResult.add_member(:end_time, Shapes::ShapeRef.new(shape: Double, location_name: "EndTime"))
116
+ MedicalResult.add_member(:is_partial, Shapes::ShapeRef.new(shape: Boolean, location_name: "IsPartial"))
117
+ MedicalResult.add_member(:alternatives, Shapes::ShapeRef.new(shape: MedicalAlternativeList, location_name: "Alternatives"))
118
+ MedicalResult.add_member(:channel_id, Shapes::ShapeRef.new(shape: String, location_name: "ChannelId"))
119
+ MedicalResult.struct_class = Types::MedicalResult
120
+
121
+ MedicalResultList.member = Shapes::ShapeRef.new(shape: MedicalResult)
122
+
123
+ MedicalTranscript.add_member(:results, Shapes::ShapeRef.new(shape: MedicalResultList, location_name: "Results"))
124
+ MedicalTranscript.struct_class = Types::MedicalTranscript
125
+
126
+ MedicalTranscriptEvent.add_member(:transcript, Shapes::ShapeRef.new(shape: MedicalTranscript, location_name: "Transcript"))
127
+ MedicalTranscriptEvent.struct_class = Types::MedicalTranscriptEvent
128
+
129
+ MedicalTranscriptResultStream.add_member(:transcript_event, Shapes::ShapeRef.new(shape: MedicalTranscriptEvent, event: true, location_name: "TranscriptEvent"))
130
+ MedicalTranscriptResultStream.add_member(:bad_request_exception, Shapes::ShapeRef.new(shape: BadRequestException, event: true, location_name: "BadRequestException"))
131
+ MedicalTranscriptResultStream.add_member(:limit_exceeded_exception, Shapes::ShapeRef.new(shape: LimitExceededException, event: true, location_name: "LimitExceededException"))
132
+ MedicalTranscriptResultStream.add_member(:internal_failure_exception, Shapes::ShapeRef.new(shape: InternalFailureException, event: true, location_name: "InternalFailureException"))
133
+ MedicalTranscriptResultStream.add_member(:conflict_exception, Shapes::ShapeRef.new(shape: ConflictException, event: true, location_name: "ConflictException"))
134
+ MedicalTranscriptResultStream.add_member(:service_unavailable_exception, Shapes::ShapeRef.new(shape: ServiceUnavailableException, event: true, location_name: "ServiceUnavailableException"))
135
+ MedicalTranscriptResultStream.struct_class = Types::MedicalTranscriptResultStream
136
+
83
137
  Result.add_member(:result_id, Shapes::ShapeRef.new(shape: String, location_name: "ResultId"))
84
138
  Result.add_member(:start_time, Shapes::ShapeRef.new(shape: Double, location_name: "StartTime"))
85
139
  Result.add_member(:end_time, Shapes::ShapeRef.new(shape: Double, location_name: "EndTime"))
@@ -93,6 +147,37 @@ module Aws::TranscribeStreamingService
93
147
  ServiceUnavailableException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
94
148
  ServiceUnavailableException.struct_class = Types::ServiceUnavailableException
95
149
 
150
+ StartMedicalStreamTranscriptionRequest.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, required: true, location: "header", location_name: "x-amzn-transcribe-language-code"))
151
+ StartMedicalStreamTranscriptionRequest.add_member(:media_sample_rate_hertz, Shapes::ShapeRef.new(shape: MediaSampleRateHertz, required: true, location: "header", location_name: "x-amzn-transcribe-sample-rate"))
152
+ StartMedicalStreamTranscriptionRequest.add_member(:media_encoding, Shapes::ShapeRef.new(shape: MediaEncoding, required: true, location: "header", location_name: "x-amzn-transcribe-media-encoding"))
153
+ StartMedicalStreamTranscriptionRequest.add_member(:vocabulary_name, Shapes::ShapeRef.new(shape: VocabularyName, location: "header", location_name: "x-amzn-transcribe-vocabulary-name"))
154
+ StartMedicalStreamTranscriptionRequest.add_member(:specialty, Shapes::ShapeRef.new(shape: Specialty, required: true, location: "header", location_name: "x-amzn-transcribe-specialty"))
155
+ StartMedicalStreamTranscriptionRequest.add_member(:type, Shapes::ShapeRef.new(shape: Type, required: true, location: "header", location_name: "x-amzn-transcribe-type"))
156
+ StartMedicalStreamTranscriptionRequest.add_member(:show_speaker_label, Shapes::ShapeRef.new(shape: Boolean, location: "header", location_name: "x-amzn-transcribe-show-speaker-label"))
157
+ StartMedicalStreamTranscriptionRequest.add_member(:session_id, Shapes::ShapeRef.new(shape: SessionId, location: "header", location_name: "x-amzn-transcribe-session-id"))
158
+ StartMedicalStreamTranscriptionRequest.add_member(:audio_stream, Shapes::ShapeRef.new(shape: AudioStream, required: true, eventstream: true, location_name: "AudioStream"))
159
+ StartMedicalStreamTranscriptionRequest.add_member(:enable_channel_identification, Shapes::ShapeRef.new(shape: Boolean, location: "header", location_name: "x-amzn-transcribe-enable-channel-identification"))
160
+ StartMedicalStreamTranscriptionRequest.add_member(:number_of_channels, Shapes::ShapeRef.new(shape: NumberOfChannels, location: "header", location_name: "x-amzn-transcribe-number-of-channels"))
161
+ StartMedicalStreamTranscriptionRequest.struct_class = Types::StartMedicalStreamTranscriptionRequest
162
+ StartMedicalStreamTranscriptionRequest[:payload] = :audio_stream
163
+ StartMedicalStreamTranscriptionRequest[:payload_member] = StartMedicalStreamTranscriptionRequest.member(:audio_stream)
164
+
165
+ StartMedicalStreamTranscriptionResponse.add_member(:request_id, Shapes::ShapeRef.new(shape: RequestId, location: "header", location_name: "x-amzn-request-id"))
166
+ StartMedicalStreamTranscriptionResponse.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, location: "header", location_name: "x-amzn-transcribe-language-code"))
167
+ StartMedicalStreamTranscriptionResponse.add_member(:media_sample_rate_hertz, Shapes::ShapeRef.new(shape: MediaSampleRateHertz, location: "header", location_name: "x-amzn-transcribe-sample-rate"))
168
+ StartMedicalStreamTranscriptionResponse.add_member(:media_encoding, Shapes::ShapeRef.new(shape: MediaEncoding, location: "header", location_name: "x-amzn-transcribe-media-encoding"))
169
+ StartMedicalStreamTranscriptionResponse.add_member(:vocabulary_name, Shapes::ShapeRef.new(shape: VocabularyName, location: "header", location_name: "x-amzn-transcribe-vocabulary-name"))
170
+ StartMedicalStreamTranscriptionResponse.add_member(:specialty, Shapes::ShapeRef.new(shape: Specialty, location: "header", location_name: "x-amzn-transcribe-specialty"))
171
+ StartMedicalStreamTranscriptionResponse.add_member(:type, Shapes::ShapeRef.new(shape: Type, location: "header", location_name: "x-amzn-transcribe-type"))
172
+ StartMedicalStreamTranscriptionResponse.add_member(:show_speaker_label, Shapes::ShapeRef.new(shape: Boolean, location: "header", location_name: "x-amzn-transcribe-show-speaker-label"))
173
+ StartMedicalStreamTranscriptionResponse.add_member(:session_id, Shapes::ShapeRef.new(shape: SessionId, location: "header", location_name: "x-amzn-transcribe-session-id"))
174
+ StartMedicalStreamTranscriptionResponse.add_member(:transcript_result_stream, Shapes::ShapeRef.new(shape: MedicalTranscriptResultStream, eventstream: true, location_name: "TranscriptResultStream"))
175
+ StartMedicalStreamTranscriptionResponse.add_member(:enable_channel_identification, Shapes::ShapeRef.new(shape: Boolean, location: "header", location_name: "x-amzn-transcribe-enable-channel-identification"))
176
+ StartMedicalStreamTranscriptionResponse.add_member(:number_of_channels, Shapes::ShapeRef.new(shape: NumberOfChannels, location: "header", location_name: "x-amzn-transcribe-number-of-channels"))
177
+ StartMedicalStreamTranscriptionResponse.struct_class = Types::StartMedicalStreamTranscriptionResponse
178
+ StartMedicalStreamTranscriptionResponse[:payload] = :transcript_result_stream
179
+ StartMedicalStreamTranscriptionResponse[:payload_member] = StartMedicalStreamTranscriptionResponse.member(:transcript_result_stream)
180
+
96
181
  StartStreamTranscriptionRequest.add_member(:language_code, Shapes::ShapeRef.new(shape: LanguageCode, required: true, location: "header", location_name: "x-amzn-transcribe-language-code"))
97
182
  StartStreamTranscriptionRequest.add_member(:media_sample_rate_hertz, Shapes::ShapeRef.new(shape: MediaSampleRateHertz, required: true, location: "header", location_name: "x-amzn-transcribe-sample-rate"))
98
183
  StartStreamTranscriptionRequest.add_member(:media_encoding, Shapes::ShapeRef.new(shape: MediaEncoding, required: true, location: "header", location_name: "x-amzn-transcribe-media-encoding"))
@@ -156,6 +241,20 @@ module Aws::TranscribeStreamingService
156
241
  "uid" => "transcribe-streaming-2017-10-26",
157
242
  }
158
243
 
244
+ api.add_operation(:start_medical_stream_transcription, Seahorse::Model::Operation.new.tap do |o|
245
+ o.name = "StartMedicalStreamTranscription"
246
+ o.http_method = "POST"
247
+ o.http_request_uri = "/medical-stream-transcription"
248
+ o.input = Shapes::ShapeRef.new(shape: StartMedicalStreamTranscriptionRequest)
249
+ o.output = Shapes::ShapeRef.new(shape: StartMedicalStreamTranscriptionResponse)
250
+ o.errors << Shapes::ShapeRef.new(shape: BadRequestException)
251
+ o.errors << Shapes::ShapeRef.new(shape: LimitExceededException)
252
+ o.errors << Shapes::ShapeRef.new(shape: InternalFailureException)
253
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
254
+ o.errors << Shapes::ShapeRef.new(shape: ServiceUnavailableException)
255
+ o.async = true
256
+ end)
257
+
159
258
  api.add_operation(:start_stream_transcription, Seahorse::Model::Operation.new.tap do |o|
160
259
  o.name = "StartStreamTranscription"
161
260
  o.http_method = "POST"
@@ -33,6 +33,89 @@ module Aws::TranscribeStreamingService
33
33
 
34
34
  end
35
35
 
36
+ class AudioStream
37
+
38
+ def initialize
39
+ @event_emitter = Aws::EventEmitter.new
40
+ end
41
+
42
+ # @option params [String, StringIO, File] :audio_chunk
43
+ # An audio blob that contains the next part of the audio that you want
44
+ # to transcribe.
45
+ #
46
+ def signal_audio_event_event(params = {})
47
+ @event_emitter.emit(:audio_event, params)
48
+ end
49
+
50
+ def signal_end_stream
51
+ @event_emitter.emit(:end_stream, {})
52
+ end
53
+
54
+ # @api private
55
+ # @return Aws::EventEmitter
56
+ attr_reader :event_emitter
57
+
58
+ end
59
+
60
+ class MedicalTranscriptResultStream
61
+
62
+ def initialize
63
+ @event_emitter = Aws::EventEmitter.new
64
+ end
65
+
66
+ def on_transcript_event_event(&block)
67
+ @event_emitter.on(:transcript_event, block) if block_given?
68
+ end
69
+
70
+ def on_bad_request_exception_event(&block)
71
+ @event_emitter.on(:bad_request_exception, block) if block_given?
72
+ end
73
+
74
+ def on_limit_exceeded_exception_event(&block)
75
+ @event_emitter.on(:limit_exceeded_exception, block) if block_given?
76
+ end
77
+
78
+ def on_internal_failure_exception_event(&block)
79
+ @event_emitter.on(:internal_failure_exception, block) if block_given?
80
+ end
81
+
82
+ def on_conflict_exception_event(&block)
83
+ @event_emitter.on(:conflict_exception, block) if block_given?
84
+ end
85
+
86
+ def on_service_unavailable_exception_event(&block)
87
+ @event_emitter.on(:service_unavailable_exception, block) if block_given?
88
+ end
89
+
90
+ def on_error_event(&block)
91
+ @event_emitter.on(:error, block) if block_given?
92
+ end
93
+
94
+ def on_initial_response_event(&block)
95
+ @event_emitter.on(:initial_response, block) if block_given?
96
+ end
97
+
98
+ def on_unknown_event(&block)
99
+ @event_emitter.on(:unknown_event, block) if block_given?
100
+ end
101
+
102
+ def on_event(&block)
103
+ on_transcript_event_event(&block)
104
+ on_bad_request_exception_event(&block)
105
+ on_limit_exceeded_exception_event(&block)
106
+ on_internal_failure_exception_event(&block)
107
+ on_conflict_exception_event(&block)
108
+ on_service_unavailable_exception_event(&block)
109
+ on_error_event(&block)
110
+ on_initial_response_event(&block)
111
+ on_unknown_event(&block)
112
+ end
113
+
114
+ # @api private
115
+ # @return Aws::EventEmitter
116
+ attr_reader :event_emitter
117
+
118
+ end
36
119
  class TranscriptResultStream
37
120
 
38
121
  def initialize
@@ -52,10 +52,11 @@ module Aws::TranscribeStreamingService
52
52
  include Aws::Structure
53
53
  end
54
54
 
55
- # One or more arguments to the `StartStreamTranscription` operation was
56
- # invalid. For example, `MediaEncoding` was not set to `pcm` or
57
- # `LanguageCode` was not set to a valid code. Check the parameters and
58
- # try your request again.
55
+ # One or more arguments to the `StartStreamTranscription` or
56
+ # `StartMedicalStreamTranscription` operation was invalid. For example,
57
+ # `MediaEncoding` was not set to a valid encoding, or `LanguageCode` was
58
+ # not set to a valid code. Check the parameters and try your request
59
+ # again.
59
60
  #
60
61
  # @!attribute [rw] message
61
62
  # @return [String]
@@ -84,8 +85,9 @@ module Aws::TranscribeStreamingService
84
85
  include Aws::Structure
85
86
  end
86
87
 
87
- # A problem occurred while processing the audio. Amazon Transcribe
88
- # terminated processing. Try your request again.
88
+ # A problem occurred while processing the audio. Amazon Transcribe or
89
+ # Amazon Transcribe Medical terminated processing. Try your request
90
+ # again.
89
91
  #
90
92
  # @!attribute [rw] message
91
93
  # @return [String]
@@ -163,6 +165,162 @@ module Aws::TranscribeStreamingService
163
165
  include Aws::Structure
164
166
  end
165
167
 
168
+ # A list of possible transcriptions for the audio.
169
+ #
170
+ # @!attribute [rw] transcript
171
+ # The text that was transcribed from the audio.
172
+ # @return [String]
173
+ #
174
+ # @!attribute [rw] items
175
+ # A list of objects that contains words and punctuation marks that
176
+ # represents one or more interpretations of the input audio.
177
+ # @return [Array<Types::MedicalItem>]
178
+ #
179
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalAlternative AWS API Documentation
180
+ #
181
+ class MedicalAlternative < Struct.new(
182
+ :transcript,
183
+ :items)
184
+ SENSITIVE = []
185
+ include Aws::Structure
186
+ end
187
+
188
+ # A word or punctuation that is transcribed from the input audio.
189
+ #
190
+ # @!attribute [rw] start_time
191
+ # The number of seconds into an audio stream that indicates the
192
+ # creation time of an item.
193
+ # @return [Float]
194
+ #
195
+ # @!attribute [rw] end_time
196
+ # The number of seconds into an audio stream that indicates the
197
+ # creation time of an item.
198
+ # @return [Float]
199
+ #
200
+ # @!attribute [rw] type
201
+ # The type of the item. `PRONUNCIATION` indicates that the item is a
202
+ # word that was recognized in the input audio. `PUNCTUATION` indicates
203
+ # that the item was interpreted as a pause in the input audio, such as
204
+ # a period to indicate the end of a sentence.
205
+ # @return [String]
206
+ #
207
+ # @!attribute [rw] content
208
+ # The word or punctuation mark that was recognized in the input audio.
209
+ # @return [String]
210
+ #
211
+ # @!attribute [rw] confidence
212
+ # A value between 0 and 1 for an item that is a confidence score that
213
+ # Amazon Transcribe Medical assigns to each word that it transcribes.
214
+ # @return [Float]
215
+ #
216
+ # @!attribute [rw] speaker
217
+ # If speaker identification is enabled, shows the integer values that
218
+ # correspond to the different speakers identified in the stream. For
219
+ # example, if the value of `Speaker` in the stream is either a `0` or
220
+ # a `1`, that indicates that Amazon Transcribe Medical has identified
221
+ # two speakers in the stream. The value of `0` corresponds to one
222
+ # speaker and the value of `1` corresponds to the other speaker.
223
+ # @return [String]
224
+ #
225
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalItem AWS API Documentation
226
+ #
227
+ class MedicalItem < Struct.new(
228
+ :start_time,
229
+ :end_time,
230
+ :type,
231
+ :content,
232
+ :confidence,
233
+ :speaker)
234
+ SENSITIVE = []
235
+ include Aws::Structure
236
+ end
237
+
238
+ # The results of transcribing a portion of the input audio stream.
239
+ #
240
+ # @!attribute [rw] result_id
241
+ # A unique identifier for the result.
242
+ # @return [String]
243
+ #
244
+ # @!attribute [rw] start_time
245
+ # The time, in seconds, from the beginning of the audio stream to the
246
+ # beginning of the result.
247
+ # @return [Float]
248
+ #
249
+ # @!attribute [rw] end_time
250
+ # The time, in seconds, from the beginning of the audio stream to the
251
+ # end of the result.
252
+ # @return [Float]
253
+ #
254
+ # @!attribute [rw] is_partial
255
+ # Amazon Transcribe Medical divides the incoming audio stream into
256
+ # segments at natural points in the audio. Transcription results are
257
+ # returned based on these segments.
258
+ #
259
+ # The `IsPartial` field is `true` to indicate that Amazon Transcribe
260
+ # Medical has additional transcription data to send. The `IsPartial`
261
+ # field is `false` to indicate that this is the last transcription
262
+ # result for the segment.
263
+ # @return [Boolean]
264
+ #
265
+ # @!attribute [rw] alternatives
266
+ # A list of possible transcriptions of the audio. Each alternative
267
+ # typically contains one `Item` that contains the result of the
268
+ # transcription.
269
+ # @return [Array<Types::MedicalAlternative>]
270
+ #
271
+ # @!attribute [rw] channel_id
272
+ # When channel identification is enabled, Amazon Transcribe Medical
273
+ # transcribes the speech from each audio channel separately.
274
+ #
275
+ # You can use `ChannelId` to retrieve the transcription results for a
276
+ # single channel in your audio stream.
277
+ # @return [String]
278
+ #
279
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalResult AWS API Documentation
280
+ #
281
+ class MedicalResult < Struct.new(
282
+ :result_id,
283
+ :start_time,
284
+ :end_time,
285
+ :is_partial,
286
+ :alternatives,
287
+ :channel_id)
288
+ SENSITIVE = []
289
+ include Aws::Structure
290
+ end
291
+
292
+ # The medical transcript in a MedicalTranscriptEvent.
293
+ #
294
+ # @!attribute [rw] results
295
+ # MedicalResult objects that contain the results of transcribing a
296
+ # portion of the input audio stream. The array can be empty.
297
+ # @return [Array<Types::MedicalResult>]
298
+ #
299
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalTranscript AWS API Documentation
300
+ #
301
+ class MedicalTranscript < Struct.new(
302
+ :results)
303
+ SENSITIVE = []
304
+ include Aws::Structure
305
+ end
306
+
307
+ # Represents a set of transcription results from the server to the
308
+ # client. It contains one or more segments of the transcription.
309
+ #
310
+ # @!attribute [rw] transcript
311
+ # The transcription of the audio stream. The transcription is composed
312
+ # of all of the items in the results list.
313
+ # @return [Types::MedicalTranscript]
314
+ #
315
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalTranscriptEvent AWS API Documentation
316
+ #
317
+ class MedicalTranscriptEvent < Struct.new(
318
+ :transcript,
319
+ :event_type)
320
+ SENSITIVE = []
321
+ include Aws::Structure
322
+ end
323
+
166
324
  # The result of transcribing a portion of the input audio stream.
167
325
  #
168
326
  # @!attribute [rw] result_id
@@ -230,13 +388,182 @@ module Aws::TranscribeStreamingService
230
388
  include Aws::Structure
231
389
  end
232
390
 
391
+ # @note When making an API call, you may pass StartMedicalStreamTranscriptionRequest
392
+ # data as a hash:
393
+ #
394
+ # {
395
+ # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE, pt-BR, ja-JP, ko-KR
396
+ # media_sample_rate_hertz: 1, # required
397
+ # media_encoding: "pcm", # required, accepts pcm, ogg-opus, flac
398
+ # vocabulary_name: "VocabularyName",
399
+ # specialty: "PRIMARYCARE", # required, accepts PRIMARYCARE, CARDIOLOGY, NEUROLOGY, ONCOLOGY, RADIOLOGY, UROLOGY
400
+ # type: "CONVERSATION", # required, accepts CONVERSATION, DICTATION
401
+ # show_speaker_label: false,
402
+ # session_id: "SessionId",
403
+ # input_event_stream_hander: EventStreams::AudioStream.new,
404
+ # enable_channel_identification: false,
405
+ # number_of_channels: 1,
406
+ # }
407
+ #
408
+ # @!attribute [rw] language_code
409
+ # Indicates the source language used in the input audio stream. For
410
+ # Amazon Transcribe Medical, this is US English (en-US).
411
+ # @return [String]
412
+ #
413
+ # @!attribute [rw] media_sample_rate_hertz
414
+ # The sample rate of the input audio in Hertz. Sample rates of 16000
415
+ # Hz or higher are accepted.
416
+ # @return [Integer]
417
+ #
418
+ # @!attribute [rw] media_encoding
419
+ # The encoding used for the input audio.
420
+ # @return [String]
421
+ #
422
+ # @!attribute [rw] vocabulary_name
423
+ # The name of the medical custom vocabulary to use when processing the
424
+ # real-time stream.
425
+ # @return [String]
426
+ #
427
+ # @!attribute [rw] specialty
428
+ # The medical specialty of the clinician or provider.
429
+ # @return [String]
430
+ #
431
+ # @!attribute [rw] type
432
+ # The type of input audio. Choose `DICTATION` for a provider dictating
433
+ # patient notes. Choose `CONVERSATION` for a dialogue between a
434
+ # patient and one or more medical professionanls.
435
+ # @return [String]
436
+ #
437
+ # @!attribute [rw] show_speaker_label
438
+ # When `true`, enables speaker identification in your real-time
439
+ # stream.
440
+ # @return [Boolean]
441
+ #
442
+ # @!attribute [rw] session_id
443
+ # Optional. An identifier for the transcription session. If you don't
444
+ # provide a session ID, Amazon Transcribe generates one for you and
445
+ # returns it in the response.
446
+ # @return [String]
447
+ #
448
+ # @!attribute [rw] audio_stream
449
+ # Represents the audio stream from your application to Amazon
450
+ # Transcribe.
451
+ # @return [Types::AudioStream]
452
+ #
453
+ # @!attribute [rw] enable_channel_identification
454
+ # When `true`, instructs Amazon Transcribe Medical to process each
455
+ # audio channel separately and then merge the transcription output of
456
+ # each channel into a single transcription.
457
+ #
458
+ # Amazon Transcribe Medical also produces a transcription of each
459
+ # item. An item includes the start time, end time, and any alternative
460
+ # transcriptions.
461
+ #
462
+ # You can't set both `ShowSpeakerLabel` and
463
+ # `EnableChannelIdentification` in the same request. If you set both,
464
+ # your request returns a `BadRequestException`.
465
+ # @return [Boolean]
466
+ #
467
+ # @!attribute [rw] number_of_channels
468
+ # The number of channels that are in your audio stream.
469
+ # @return [Integer]
470
+ #
471
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartMedicalStreamTranscriptionRequest AWS API Documentation
472
+ #
473
+ class StartMedicalStreamTranscriptionRequest < Struct.new(
474
+ :language_code,
475
+ :media_sample_rate_hertz,
476
+ :media_encoding,
477
+ :vocabulary_name,
478
+ :specialty,
479
+ :type,
480
+ :show_speaker_label,
481
+ :session_id,
482
+ :audio_stream,
483
+ :enable_channel_identification,
484
+ :number_of_channels)
485
+ SENSITIVE = []
486
+ include Aws::Structure
487
+ end
488
+
489
+ # @!attribute [rw] request_id
490
+ # An identifier for the streaming transcription.
491
+ # @return [String]
492
+ #
493
+ # @!attribute [rw] language_code
494
+ # The language code for the response transcript. For Amazon Transcribe
495
+ # Medical, this is US English (en-US).
496
+ # @return [String]
497
+ #
498
+ # @!attribute [rw] media_sample_rate_hertz
499
+ # The sample rate of the input audio in Hertz. Valid value: 16000 Hz.
500
+ # @return [Integer]
501
+ #
502
+ # @!attribute [rw] media_encoding
503
+ # The encoding used for the input audio stream.
504
+ # @return [String]
505
+ #
506
+ # @!attribute [rw] vocabulary_name
507
+ # The name of the vocabulary used when processing the stream.
508
+ # @return [String]
509
+ #
510
+ # @!attribute [rw] specialty
511
+ # The specialty in the medical domain.
512
+ # @return [String]
513
+ #
514
+ # @!attribute [rw] type
515
+ # The type of audio that was transcribed.
516
+ # @return [String]
517
+ #
518
+ # @!attribute [rw] show_speaker_label
519
+ # Shows whether speaker identification was enabled in the stream.
520
+ # @return [Boolean]
521
+ #
522
+ # @!attribute [rw] session_id
523
+ # Optional. An identifier for the transcription session. If you don't
524
+ # provide a session ID, Amazon Transcribe generates one for you and
525
+ # returns it in the response.
526
+ # @return [String]
527
+ #
528
+ # @!attribute [rw] transcript_result_stream
529
+ # Represents the stream of transcription events from Amazon Transcribe
530
+ # Medical to your application.
531
+ # @return [Types::MedicalTranscriptResultStream]
532
+ #
533
+ # @!attribute [rw] enable_channel_identification
534
+ # Shows whether channel identification has been enabled in the stream.
535
+ # @return [Boolean]
536
+ #
537
+ # @!attribute [rw] number_of_channels
538
+ # The number of channels identified in the stream.
539
+ # @return [Integer]
540
+ #
541
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/StartMedicalStreamTranscriptionResponse AWS API Documentation
542
+ #
543
+ class StartMedicalStreamTranscriptionResponse < Struct.new(
544
+ :request_id,
545
+ :language_code,
546
+ :media_sample_rate_hertz,
547
+ :media_encoding,
548
+ :vocabulary_name,
549
+ :specialty,
550
+ :type,
551
+ :show_speaker_label,
552
+ :session_id,
553
+ :transcript_result_stream,
554
+ :enable_channel_identification,
555
+ :number_of_channels)
556
+ SENSITIVE = []
557
+ include Aws::Structure
558
+ end
559
+
233
560
  # @note When making an API call, you may pass StartStreamTranscriptionRequest
234
561
  # data as a hash:
235
562
  #
236
563
  # {
237
- # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE
564
+ # language_code: "en-US", # required, accepts en-US, en-GB, es-US, fr-CA, fr-FR, en-AU, it-IT, de-DE, pt-BR, ja-JP, ko-KR
238
565
  # media_sample_rate_hertz: 1, # required
239
- # media_encoding: "pcm", # required, accepts pcm
566
+ # media_encoding: "pcm", # required, accepts pcm, ogg-opus, flac
240
567
  # vocabulary_name: "VocabularyName",
241
568
  # session_id: "SessionId",
242
569
  # input_event_stream_hander: EventStreams::AudioStream.new,
@@ -258,8 +585,7 @@ module Aws::TranscribeStreamingService
258
585
  # @return [Integer]
259
586
  #
260
587
  # @!attribute [rw] media_encoding
261
- # The encoding used for the input audio. `pcm` is the only valid
262
- # value.
588
+ # The encoding used for the input audio.
263
589
  # @return [String]
264
590
  #
265
591
  # @!attribute [rw] vocabulary_name
@@ -463,6 +789,29 @@ module Aws::TranscribeStreamingService
463
789
 
464
790
  end
465
791
 
792
+ # Represents the transcription result stream from Amazon Transcribe
793
+ # Medical to your application.
794
+ #
795
+ # EventStream is an Enumerator of Events.
796
+ # #event_types #=> Array, returns all modeled event types in the stream
797
+ #
798
+ # @see http://docs.aws.amazon.com/goto/WebAPI/transcribe-streaming-2017-10-26/MedicalTranscriptResultStream AWS API Documentation
799
+ #
800
+ class MedicalTranscriptResultStream < Enumerator
801
+
802
+ def event_types
803
+ [
804
+ :transcript_event,
805
+ :bad_request_exception,
806
+ :limit_exceeded_exception,
807
+ :internal_failure_exception,
808
+ :conflict_exception,
809
+ :service_unavailable_exception
810
+ ]
811
+ end
812
+
813
+ end
814
+
466
815
  # Represents the transcription result stream from Amazon Transcribe to
467
816
  # your application.
468
817
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-transcribestreamingservice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-04 00:00:00.000000000 Z
11
+ date: 2020-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core