FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
google-cloud-cpp/google/cloud/speech/speech_client.h at main · QPC-github/google-cloud-cpp · GitHub
QPC-github
/
google-cloud-cpp
Public
forked from
googleapis/google-cloud-cpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
google-cloud-cpp
/
google
/
cloud
/
speech
/
speech_client.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
213 lines (198 loc) · 8.91 KB
Breadcrumbs
google-cloud-cpp
/
google
/
cloud
/
speech
/
speech_client.h
Copy path
File metadata and controls
213 lines (198 loc) · 8.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
//
Copyright 2022 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 by the Codegen C++ plugin.
//
If you make any local changes, they will be lost.
//
source: google/cloud/speech/v1/cloud_speech.proto
#
ifndef
GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H
#
define
GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H
#
include
"
google/cloud/speech/speech_connection.h
"
#
include
"
google/cloud/future.h
"
#
include
"
google/cloud/options.h
"
#
include
"
google/cloud/polling_policy.h
"
#
include
"
google/cloud/status_or.h
"
#
include
"
google/cloud/version.h
"
#
include
<
google/longrunning/operations.grpc.pb.h
>
#
include
<
memory
>
namespace
google
{
namespace
cloud
{
namespace
speech
{
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
//
/
//
/ Service that implements Google Cloud Speech API.
//
/
//
/ @par Equality
//
/
//
/ Instances of this class created via copy-construction or copy-assignment
//
/ always compare equal. Instances created with equal
//
/ `std::shared_ptr<*Connection>` objects compare equal. Objects that compare
//
/ equal share the same underlying resources.
//
/
//
/ @par Performance
//
/
//
/ Creating a new instance of this class is a relatively expensive operation,
//
/ new objects establish new connections to the service. In contrast,
//
/ copy-construction, move-construction, and the corresponding assignment
//
/ operations are relatively efficient as the copies share all underlying
//
/ resources.
//
/
//
/ @par Thread Safety
//
/
//
/ Concurrent access to different instances of this class, even if they compare
//
/ equal, is guaranteed to work. Two or more threads operating on the same
//
/ instance of this class is not guaranteed to work. Since copy-construction
//
/ and move-construction is a relatively efficient operation, consider using
//
/ such a copy when using this class from multiple threads.
//
/
class
SpeechClient
{
public:
explicit
SpeechClient
(std::shared_ptr<SpeechConnection> connection,
Options opts = {});
~SpeechClient
();
//
/@{
//
/ @name Copy and move support
SpeechClient
(SpeechClient
const
&) =
default
;
SpeechClient&
operator
=(SpeechClient
const
&) =
default
;
SpeechClient
(SpeechClient&&) =
default
;
SpeechClient&
operator
=(SpeechClient&&) =
default
;
//
/@}
//
/@{
//
/ @name Equality
friend
bool
operator
==(SpeechClient
const
& a, SpeechClient
const
& b) {
return
a.
connection_
== b.
connection_
;
}
friend
bool
operator
!=(SpeechClient
const
& a, SpeechClient
const
& b) {
return
!(a == b);
}
//
/@}
//
/
//
/ Performs synchronous speech recognition: receive results after all audio
//
/ has been sent and processed.
//
/
//
/ @param config Required. Provides information to the recognizer that
//
/ specifies how to
//
/ process the request.
//
/ @param audio Required. The audio data to be recognized.
//
/ @param opts Optional. Override the class-level options, such as retry and
//
/ backoff policies.
//
/ @return
//
/ @googleapis_link{google::cloud::speech::v1::RecognizeResponse,google/cloud/speech/v1/cloud_speech.proto#L647}
//
/
//
/ [google.cloud.speech.v1.RecognizeRequest]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L76}
//
/ [google.cloud.speech.v1.RecognizeResponse]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L647}
//
/
StatusOr<google::cloud::speech::v1::RecognizeResponse>
Recognize
(
google::cloud::speech::v1::RecognitionConfig
const
& config,
google::cloud::speech::v1::RecognitionAudio
const
& audio,
Options opts = {});
//
/
//
/ Performs synchronous speech recognition: receive results after all audio
//
/ has been sent and processed.
//
/
//
/ @param request
//
/ @googleapis_link{google::cloud::speech::v1::RecognizeRequest,google/cloud/speech/v1/cloud_speech.proto#L76}
//
/ @param opts Optional. Override the class-level options, such as retry and
//
/ backoff policies.
//
/ @return
//
/ @googleapis_link{google::cloud::speech::v1::RecognizeResponse,google/cloud/speech/v1/cloud_speech.proto#L647}
//
/
//
/ [google.cloud.speech.v1.RecognizeRequest]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L76}
//
/ [google.cloud.speech.v1.RecognizeResponse]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L647}
//
/
StatusOr<google::cloud::speech::v1::RecognizeResponse>
Recognize
(
google::cloud::speech::v1::RecognizeRequest
const
& request,
Options opts = {});
//
/
//
/ Performs asynchronous speech recognition: receive results via the
//
/ google.longrunning.Operations interface. Returns either an
//
/ `Operation.error` or an `Operation.response` which contains
//
/ a `LongRunningRecognizeResponse` message.
//
/ For more information on asynchronous speech recognition, see the
//
/ [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
//
/
//
/ @param config Required. Provides information to the recognizer that
//
/ specifies how to
//
/ process the request.
//
/ @param audio Required. The audio data to be recognized.
//
/ @param opts Optional. Override the class-level options, such as retry and
//
/ backoff policies.
//
/ @return
//
/ @googleapis_link{google::cloud::speech::v1::LongRunningRecognizeResponse,google/cloud/speech/v1/cloud_speech.proto#L668}
//
/
//
/ [google.cloud.speech.v1.LongRunningRecognizeRequest]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L87}
//
/ [google.cloud.speech.v1.LongRunningRecognizeResponse]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L668}
//
/
future<StatusOr<google::cloud::speech::v1::LongRunningRecognizeResponse>>
LongRunningRecognize
(
google::cloud::speech::v1::RecognitionConfig
const
& config,
google::cloud::speech::v1::RecognitionAudio
const
& audio,
Options opts = {});
//
/
//
/ Performs asynchronous speech recognition: receive results via the
//
/ google.longrunning.Operations interface. Returns either an
//
/ `Operation.error` or an `Operation.response` which contains
//
/ a `LongRunningRecognizeResponse` message.
//
/ For more information on asynchronous speech recognition, see the
//
/ [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
//
/
//
/ @param request
//
/ @googleapis_link{google::cloud::speech::v1::LongRunningRecognizeRequest,google/cloud/speech/v1/cloud_speech.proto#L87}
//
/ @param opts Optional. Override the class-level options, such as retry and
//
/ backoff policies.
//
/ @return
//
/ @googleapis_link{google::cloud::speech::v1::LongRunningRecognizeResponse,google/cloud/speech/v1/cloud_speech.proto#L668}
//
/
//
/ [google.cloud.speech.v1.LongRunningRecognizeRequest]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L87}
//
/ [google.cloud.speech.v1.LongRunningRecognizeResponse]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L668}
//
/
future<StatusOr<google::cloud::speech::v1::LongRunningRecognizeResponse>>
LongRunningRecognize
(
google::cloud::speech::v1::LongRunningRecognizeRequest
const
& request,
Options opts = {});
//
/
//
/ Performs bidirectional streaming speech recognition: receive results while
//
/ sending audio. This method is only available via the gRPC API (not REST).
//
/
//
/ @param opts Optional. Override the class-level options, such as retry and
//
/ backoff policies.
//
/ @return A bidirectional streaming interface with request (write) type:
//
/ @googleapis_link{google::cloud::speech::v1::StreamingRecognizeRequest,google/cloud/speech/v1/cloud_speech.proto#L114}
//
/ and response (read) type:
//
/ @googleapis_link{google::cloud::speech::v1::StreamingRecognizeResponse,google/cloud/speech/v1/cloud_speech.proto#L758}
//
/
//
/ [google.cloud.speech.v1.StreamingRecognizeRequest]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L114}
//
/ [google.cloud.speech.v1.StreamingRecognizeResponse]:
//
/ @googleapis_reference_link{google/cloud/speech/v1/cloud_speech.proto#L758}
//
/
std::unique_ptr<::google::cloud::AsyncStreamingReadWriteRpc<
google::cloud::speech::v1::StreamingRecognizeRequest,
google::cloud::speech::v1::StreamingRecognizeResponse>>
AsyncStreamingRecognize
(Options opts = {});
private:
std::shared_ptr<SpeechConnection> connection_;
Options options_;
};
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
}
//
namespace speech
}
//
namespace cloud
}
//
namespace google
#
endif
//
GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_SPEECH_SPEECH_CLIENT_H
Back
|
FazBrowse Home
|
New Git URL