# Google Cloud Text-to-Speech v1 API - Class TextToSpeechLongAudioSynthesizeClient (3.18.0)

3.18.0 (latest) 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.5.0 2.4.0 2.3.0 2.2.0

    public abstract class TextToSpeechLongAudioSynthesizeClient

Reference documentation and code samples for the Google Cloud Text-to-Speech v1 API class TextToSpeechLongAudioSynthesizeClient.

TextToSpeechLongAudioSynthesize client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> TextToSpeechLongAudioSynthesizeClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[TextToSpeechLongAudioSynthesizeClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClientImpl)

## Namespace

[Google.Cloud.TextToSpeech.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1)

## Assembly

Google.Cloud.TextToSpeech.V1.dll

## Remarks

Service that implements Google Cloud Text-to-Speech API.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the TextToSpeechLongAudioSynthesize service, which is a host of
"texttospeech.googleapis.com" and a port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default TextToSpeechLongAudioSynthesize scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default TextToSpeechLongAudioSynthesize scopes are:

- <https://www.googleapis.com/auth/cloud-platform>

### GrpcClient

    public virtual TextToSpeechLongAudioSynthesize.TextToSpeechLongAudioSynthesizeClient GrpcClient { get; }

The underlying gRPC TextToSpeechLongAudioSynthesize client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesize.TextToSpeechLongAudioSynthesizeClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

### SynthesizeLongAudioOperationsClient

    public virtual OperationsClient SynthesizeLongAudioOperationsClient { get; }

The long-running operations client for `SynthesizeLongAudio`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

## Methods

### Create()

    public static TextToSpeechLongAudioSynthesizeClient Create()

Synchronously creates a [TextToSpeechLongAudioSynthesizeClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[TextToSpeechLongAudioSynthesizeClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient` | The created [TextToSpeechLongAudioSynthesizeClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient). |

### CreateAsync(CancellationToken)

    public static Task<TextToSpeechLongAudioSynthesizeClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [TextToSpeechLongAudioSynthesizeClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[TextToSpeechLongAudioSynthesizeClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient` | The task representing the created [TextToSpeechLongAudioSynthesizeClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient). |

### PollOnceSynthesizeLongAudio(string, CallSettings)

    public virtual Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> PollOnceSynthesizeLongAudio(string operationName, CallSettings callSettings = null)

Poll an operation once, using an `operationName` from a previous invocation of `SynthesizeLongAudio`
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioMetadata` | The result of polling the operation. |

### PollOnceSynthesizeLongAudioAsync(string, CallSettings)

    public virtual Task<Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata>> PollOnceSynthesizeLongAudioAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an `operationName` from a previous invocation of
`SynthesizeLongAudio`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioMetadata` | A task representing the result of polling the operation. |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient#Google_Cloud_TextToSpeech_V1_TextToSpeechLongAudioSynthesizeClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient#Google_Cloud_TextToSpeech_V1_TextToSpeechLongAudioSynthesizeClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient#Google_Cloud_TextToSpeech_V1_TextToSpeechLongAudioSynthesizeClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.TextToSpeechLongAudioSynthesizeClient#Google_Cloud_TextToSpeech_V1_TextToSpeechLongAudioSynthesizeClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

### SynthesizeLongAudio(SynthesizeLongAudioRequest, CallSettings)

    public virtual Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> SynthesizeLongAudio(SynthesizeLongAudioRequest request, CallSettings callSettings = null)

Synthesizes long form text asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioMetadata` | The RPC response. |

**Example**

    // Create client
    TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = TextToSpeechLongAudioSynthesizeClient.Create();
    // Initialize request argument(s)
    SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest
    {
        Parent = "",
        Input = new SynthesisInput(),
        AudioConfig = new AudioConfig(),
        OutputGcsUri = "",
        Voice = new VoiceSelectionParams(),
    };
    // Make the request
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudio(request);

    // Poll until the returned long-running operation is complete
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    SynthesizeLongAudioResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudio(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result;
    }

### SynthesizeLongAudioAsync(SynthesizeLongAudioRequest, CallSettings)

    public virtual Task<Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata>> SynthesizeLongAudioAsync(SynthesizeLongAudioRequest request, CallSettings callSettings = null)

Synthesizes long form text asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = await TextToSpeechLongAudioSynthesizeClient.CreateAsync();
    // Initialize request argument(s)
    SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest
    {
        Parent = "",
        Input = new SynthesisInput(),
        AudioConfig = new AudioConfig(),
        OutputGcsUri = "",
        Voice = new VoiceSelectionParams(),
    };
    // Make the request
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = await textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    SynthesizeLongAudioResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = await textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudioAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result;
    }

### SynthesizeLongAudioAsync(SynthesizeLongAudioRequest, CancellationToken)

    public virtual Task<Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata>> SynthesizeLongAudioAsync(SynthesizeLongAudioRequest request, CancellationToken cancellationToken)

Synthesizes long form text asynchronously.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.TextToSpeech.V1/latest/Google.Cloud.TextToSpeech.V1.SynthesizeLongAudioMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    TextToSpeechLongAudioSynthesizeClient textToSpeechLongAudioSynthesizeClient = await TextToSpeechLongAudioSynthesizeClient.CreateAsync();
    // Initialize request argument(s)
    SynthesizeLongAudioRequest request = new SynthesizeLongAudioRequest
    {
        Parent = "",
        Input = new SynthesisInput(),
        AudioConfig = new AudioConfig(),
        OutputGcsUri = "",
        Voice = new VoiceSelectionParams(),
    };
    // Make the request
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> response = await textToSpeechLongAudioSynthesizeClient.SynthesizeLongAudioAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    SynthesizeLongAudioResponse result = completedResponse.Result;

    // Or get the name of the operation
    string operationName = response.Name;
    // This name can be stored, then the long-running operation retrieved later by name
    Operation<SynthesizeLongAudioResponse, SynthesizeLongAudioMetadata> retrievedResponse = await textToSpeechLongAudioSynthesizeClient.PollOnceSynthesizeLongAudioAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        SynthesizeLongAudioResponse retrievedResult = retrievedResponse.Result;
    }