Skip to content

Commit

Permalink
feat: expand the set of supported explicit audio encodings
Browse files Browse the repository at this point in the history
docs: updated ExplicitDecodingConfig documentation to reflect changes related to newly supported encodings

PiperOrigin-RevId: 708316885

Source-Link: googleapis/googleapis@bf2a7ca

Source-Link: googleapis/googleapis-gen@4989c73
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3BlZWNoLlYyLy5Pd2xCb3QueWFtbCIsImgiOiI0OTg5YzczNDY5ZmVhMjhlNTE4MWU5NjFhODNhZmZmZjcwYjg0M2I0In0=
  • Loading branch information
gcf-owl-bot[bot] committed Dec 20, 2024
1 parent f906e6a commit 3d59a9d
Show file tree
Hide file tree
Showing 142 changed files with 52,523 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../Google.Cloud.Speech.V2/Google.Cloud.Speech.V2.csproj" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START speech_v2_generated_Speech_BatchRecognize_async_flattened]
using Google.Cloud.Speech.V2;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Collections.Generic;
using System.Threading.Tasks;

public sealed partial class GeneratedSpeechClientSnippets
{
/// <summary>Snippet for BatchRecognizeAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task BatchRecognizeAsync()
{
// Create client
SpeechClient speechClient = await SpeechClient.CreateAsync();
// Initialize request argument(s)
string recognizer = "projects/[PROJECT]/locations/[LOCATION]/recognizers/[RECOGNIZER]";
RecognitionConfig config = new RecognitionConfig();
FieldMask configMask = new FieldMask();
IEnumerable<BatchRecognizeFileMetadata> files = new BatchRecognizeFileMetadata[]
{
new BatchRecognizeFileMetadata(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = await speechClient.BatchRecognizeAsync(recognizer, config, configMask, files);

// Poll until the returned long-running operation is complete
Operation<BatchRecognizeResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchRecognizeResponse 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<BatchRecognizeResponse, OperationMetadata> retrievedResponse = await speechClient.PollOnceBatchRecognizeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchRecognizeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END speech_v2_generated_Speech_BatchRecognize_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START speech_v2_generated_Speech_BatchRecognize_async]
using Google.Cloud.Speech.V2;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Threading.Tasks;

public sealed partial class GeneratedSpeechClientSnippets
{
/// <summary>Snippet for BatchRecognizeAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task BatchRecognizeRequestObjectAsync()
{
// Create client
SpeechClient speechClient = await SpeechClient.CreateAsync();
// Initialize request argument(s)
BatchRecognizeRequest request = new BatchRecognizeRequest
{
RecognizerAsRecognizerName = RecognizerName.FromProjectLocationRecognizer("[PROJECT]", "[LOCATION]", "[RECOGNIZER]"),
Files =
{
new BatchRecognizeFileMetadata(),
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
ProcessingStrategy = BatchRecognizeRequest.Types.ProcessingStrategy.Unspecified,
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = await speechClient.BatchRecognizeAsync(request);

// Poll until the returned long-running operation is complete
Operation<BatchRecognizeResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchRecognizeResponse 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<BatchRecognizeResponse, OperationMetadata> retrievedResponse = await speechClient.PollOnceBatchRecognizeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchRecognizeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END speech_v2_generated_Speech_BatchRecognize_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START speech_v2_generated_Speech_BatchRecognize_sync]
using Google.Cloud.Speech.V2;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;

public sealed partial class GeneratedSpeechClientSnippets
{
/// <summary>Snippet for BatchRecognize</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void BatchRecognizeRequestObject()
{
// Create client
SpeechClient speechClient = SpeechClient.Create();
// Initialize request argument(s)
BatchRecognizeRequest request = new BatchRecognizeRequest
{
RecognizerAsRecognizerName = RecognizerName.FromProjectLocationRecognizer("[PROJECT]", "[LOCATION]", "[RECOGNIZER]"),
Files =
{
new BatchRecognizeFileMetadata(),
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
ProcessingStrategy = BatchRecognizeRequest.Types.ProcessingStrategy.Unspecified,
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = speechClient.BatchRecognize(request);

// Poll until the returned long-running operation is complete
Operation<BatchRecognizeResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchRecognizeResponse 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<BatchRecognizeResponse, OperationMetadata> retrievedResponse = speechClient.PollOnceBatchRecognize(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchRecognizeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END speech_v2_generated_Speech_BatchRecognize_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START speech_v2_generated_Speech_BatchRecognize_async_flattened_resourceNames]
using Google.Cloud.Speech.V2;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Collections.Generic;
using System.Threading.Tasks;

public sealed partial class GeneratedSpeechClientSnippets
{
/// <summary>Snippet for BatchRecognizeAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task BatchRecognizeResourceNamesAsync()
{
// Create client
SpeechClient speechClient = await SpeechClient.CreateAsync();
// Initialize request argument(s)
RecognizerName recognizer = RecognizerName.FromProjectLocationRecognizer("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
RecognitionConfig config = new RecognitionConfig();
FieldMask configMask = new FieldMask();
IEnumerable<BatchRecognizeFileMetadata> files = new BatchRecognizeFileMetadata[]
{
new BatchRecognizeFileMetadata(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = await speechClient.BatchRecognizeAsync(recognizer, config, configMask, files);

// Poll until the returned long-running operation is complete
Operation<BatchRecognizeResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchRecognizeResponse 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<BatchRecognizeResponse, OperationMetadata> retrievedResponse = await speechClient.PollOnceBatchRecognizeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchRecognizeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END speech_v2_generated_Speech_BatchRecognize_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START speech_v2_generated_Speech_BatchRecognize_sync_flattened_resourceNames]
using Google.Cloud.Speech.V2;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Collections.Generic;

public sealed partial class GeneratedSpeechClientSnippets
{
/// <summary>Snippet for BatchRecognize</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void BatchRecognizeResourceNames()
{
// Create client
SpeechClient speechClient = SpeechClient.Create();
// Initialize request argument(s)
RecognizerName recognizer = RecognizerName.FromProjectLocationRecognizer("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
RecognitionConfig config = new RecognitionConfig();
FieldMask configMask = new FieldMask();
IEnumerable<BatchRecognizeFileMetadata> files = new BatchRecognizeFileMetadata[]
{
new BatchRecognizeFileMetadata(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = speechClient.BatchRecognize(recognizer, config, configMask, files);

// Poll until the returned long-running operation is complete
Operation<BatchRecognizeResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchRecognizeResponse 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<BatchRecognizeResponse, OperationMetadata> retrievedResponse = speechClient.PollOnceBatchRecognize(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchRecognizeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END speech_v2_generated_Speech_BatchRecognize_sync_flattened_resourceNames]
}
Loading

0 comments on commit 3d59a9d

Please sign in to comment.