# Media Translation V1beta1 API - Class Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client (v0.16.0)

0.16.0 (latest) 0.15.0 0.14.0 0.13.1 0.12.0 0.11.1 0.10.0 0.9.1 0.8.2 0.7.0 0.6.1 0.5.0 0.4.5 Reference documentation and code samples for the Media Translation V1beta1 API class Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.

Client for the SpeechTranslationService service.


<br />

Provides translation from/to media types.

## Inherits

- Object

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the SpeechTranslationService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration "Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all SpeechTranslationService clients
::Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the SpeechTranslationService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client#Google__Cloud__MediaTranslation__V1beta1__SpeechTranslationService__Client_configure_class_ "Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration "Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration))

### #initialize

    def initialize() { |config| ... } -> Client

Create a new SpeechTranslationService client object.
**Yields**

- (config) --- Configure the SpeechTranslationService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-SpeechTranslationService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new do |config|
  config.timeout = 10.0
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #streaming_translate_speech

    def streaming_translate_speech(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse>

Performs bidirectional streaming speech translation: receive results while
sending audio. This method is only available via the gRPC API (not REST).
**Parameters**

- **request** (::Gapic::StreamInput, ::Enumerable\<[::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-StreamingTranslateSpeechRequest), ::Hash\>) --- An enumerable of [Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-StreamingTranslateSpeechRequest "Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest (class)") instances.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Enumerable\<[::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-StreamingTranslateSpeechResponse)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Enumerable\<[::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-media_translation-v1beta1/latest/Google-Cloud-MediaTranslation-V1beta1-StreamingTranslateSpeechResponse)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/media_translation/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new

# Create an input stream.
input = Gapic::StreamInput.new

# Call the streaming_translate_speech method to start streaming.
output = client.streaming_translate_speech input

# Send requests on the stream. For each request object, set fields by
# passing keyword arguments. Be sure to close the stream when done.
input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new
input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new
input.close

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse
output.each do |current_response|
  p current_response
end
```

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)