-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: expand the set of supported explicit audio encodings
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
1 parent
f906e6a
commit 3d59a9d
Showing
142 changed files
with
52,523 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
.../Google.Cloud.Speech.V2.GeneratedSnippets/Google.Cloud.Speech.V2.GeneratedSnippets.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
69 changes: 69 additions & 0 deletions
69
....V2/Google.Cloud.Speech.V2.GeneratedSnippets/SpeechClient.BatchRecognizeAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |
73 changes: 73 additions & 0 deletions
73
...oud.Speech.V2.GeneratedSnippets/SpeechClient.BatchRecognizeRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |
72 changes: 72 additions & 0 deletions
72
...le.Cloud.Speech.V2.GeneratedSnippets/SpeechClient.BatchRecognizeRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |
69 changes: 69 additions & 0 deletions
69
...oud.Speech.V2.GeneratedSnippets/SpeechClient.BatchRecognizeResourceNamesAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |
68 changes: 68 additions & 0 deletions
68
...le.Cloud.Speech.V2.GeneratedSnippets/SpeechClient.BatchRecognizeResourceNamesSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
} |
Oops, something went wrong.