Title: Google Speech API - how to catch grpc errors and close recognition correctly in speechv1 · Issue #963 · GoogleCloudPlatform/python-docs-samples · GitHub
Open Graph Title: Google Speech API - how to catch grpc errors and close recognition correctly in speechv1 · Issue #963 · GoogleCloudPlatform/python-docs-samples
X Title: Google Speech API - how to catch grpc errors and close recognition correctly in speechv1 · Issue #963 · GoogleCloudPlatform/python-docs-samples
Description: Hello. While using speechv1beta I was able to catch grpc error such as OUT_OF_RANGE and others simply with for resp in recognize_stream: if resp.error.code != code_pb2.OK: print(resp.error.message) With introducing of speechv1 actual grp...
Open Graph Description: Hello. While using speechv1beta I was able to catch grpc error such as OUT_OF_RANGE and others simply with for resp in recognize_stream: if resp.error.code != code_pb2.OK: print(resp.error.message)...
X Description: Hello. While using speechv1beta I was able to catch grpc error such as OUT_OF_RANGE and others simply with for resp in recognize_stream: if resp.error.code != code_pb2.OK: print(resp.error.message)...
Opengraph URL: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/963
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Google Speech API - how to catch grpc errors and close recognition correctly in speechv1","articleBody":"Hello. While using speechv1beta I was able to catch grpc error such as OUT_OF_RANGE and others simply with \r\n```python\r\nfor resp in recognize_stream:\r\n if resp.error.code != code_pb2.OK:\r\n print(resp.error.message)\r\n```\r\nWith introducing of speechv1 actual grpc resposces are getting handled inside the `speech` module, and I can only get `alternatives` \r\n```python\r\nalternatives = self.audio_sample.streaming_recognize(self.language, interim_results=True,\r\n profanity_filter=True)\r\n```\r\n\r\nHow can I catch grpc errors in new API?\r\n\r\n\r\nThe second question is how to stop the recognition correctly in the new API.\r\nI can't find any fucntionality as \r\n```python\r\nrecognize_stream = service.StreamingRecognize(\r\n requests, self.DEADLINE_SECS)\r\n...\r\nrecognize_stream.cancel()\r\n```\r\nin the new speechv1 api.\r\nThanks!","author":{"url":"https://github.com/datspike","@type":"Person","name":"datspike"},"datePublished":"2017-05-25T17:51:04Z","url":"https://github.com/GoogleCloudPlatform/python-docs-samples/issues/963"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2496da0d-d0bc-ff22-2618-2be66106c1ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E020:6B7A6:57DBF5:72EAA9:6AFE69A9 |
| html-safe-nonce | 267e509b7b9a0f9e9979481df77432dd771a33634bdecfd4c1dc180bb5d7960b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDIwOjZCN0E2OjU3REJGNTo3MkVBQTk6NkFGRTY5QTkiLCJ2aXNpdG9yX2lkIjoiNzYwMTQ2ODc3NDIyNjQ4NzcyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3ddf4a7e208e92158043a56a4018ef165678a6eee4581a5e6ce71ba7173905ab |
| hovercard-subject-tag | issue:231410464 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/GoogleCloudPlatform/python-docs-samples/963/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c24745febbf1207fbe747de1f758206ba1cdc43aa98b0374efc1a62d7871b170/GoogleCloudPlatform/python-docs-samples/issues/963 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c24745febbf1207fbe747de1f758206ba1cdc43aa98b0374efc1a62d7871b170/GoogleCloudPlatform/python-docs-samples/issues/963 |
| og:image:alt | Hello. While using speechv1beta I was able to catch grpc error such as OUT_OF_RANGE and others simply with for resp in recognize_stream: if resp.error.code != code_pb2.OK: print(resp.error.message)... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | datspike |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/GoogleCloudPlatform/python-docs-samples git https://github.com/GoogleCloudPlatform/python-docs-samples.git |
| octolytics-dimension-user_id | 2810941 |
| octolytics-dimension-user_login | GoogleCloudPlatform |
| octolytics-dimension-repository_id | 35065876 |
| octolytics-dimension-repository_nwo | GoogleCloudPlatform/python-docs-samples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 35065876 |
| octolytics-dimension-repository_network_root_nwo | GoogleCloudPlatform/python-docs-samples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width