awslabs / amazon-transcribe-streaming-sdk

The Amazon Transcribe Streaming SDK is an async Python SDK for converting audio into text via Amazon Transcribe.
Apache License 2.0
142 stars 37 forks source link

Improve writing into HTTP/2 streams without a read-able object #25

Open easysong opened 3 years ago

easysong commented 3 years ago

As soon as I call start_stream_transcription, this module use cpu 100%. The reason is that BufferableByteStream's read function keeps calling without sleep, but I don't know where it is called.

joguSD commented 3 years ago

@easysong Yes, this is a known issue right now. The reason you can't find where it's called is because it happens on the C side of the aws crt Python bindings. The aws crt doesn't currently provide an interface for writing into an HTTP/2 stream on the Python side of things. The best we can do right now is provide a file-like object with a read that has some quirky behavior, like the one you're mentioning.