question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose stream cancellation in speech streaming generator

See original GitHub issue

Originally from python-docs-samples#963, filed by @datspike

How do you stop recognition correctly in the new client?

With the GRPC client, you can do

recognize_stream = service.StreamingRecognize(
    requests, self.DEADLINE_SECS)
...
recognize_stream.cancel()

But this client lib only exposes the streaming_recognize call as a generator of alternatives. It would be useful to be able to cancel the stream from another thread, eg in case you need to close the stream before a response is returned.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tseavercommented, Feb 16, 2018

@Tadly Can you please open a new issue? This one is a) long-closed, and b) only tangentially related to the problem you are experiencing.

0reactions
tadlycommented, Feb 16, 2018

Pardon my intrusion but I’m kind of stuck on this.

As far as I can tell, streaming_recognize straight up blocks if the backend can’t resolve a anything from the given stream (e.g. mic is muted, no one is speaking etc.).

As I’m trying to get this implemented in an asyncio environment this is kind of bad. Even if I’d add threading (which I’d like to prevent) I’d still have the issue of it blocking -> no _Rendezvous instance.

Am I missing something obvious here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transcribe audio from streaming input | Cloud Speech-to-Text ...
This section demonstrates how to transcribe streaming audio, like the input from a microphone, to text. Streaming speech recognition allows you to stream...
Read more >
gRPC and C# 8 Async stream cancellation - Laurent Kempé
I need to extend a bit the original code of the GreeterService to take care of the client request to stop the streaming....
Read more >
Speech service release notes - Azure - Microsoft Learn
A running log of Speech Service feature releases, improvements, bug fixes, and known issues.
Read more >
Web Audio API - W3C
suspend and close allow authors to release system resources , including threads, processes and audio streams. Suspending a BaseAudioContext ...
Read more >
12 Social Media Platforms that Honor Freedom of Speech and ...
Rumble is a free-speech video streaming platform alternative to YouTube. It supports live-streams, channels and subscriptions as well as ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found