Uh oh!
There was an error while loading. Please reload this page.
Speech continuous - #1940
Conversation
| pip install pyaudio | ||
| Example usage: | ||
| python transcribe_streaming_indefinite.py |
| def get_current_time(): | ||
| return int(round(time.time() * 1000)) |
There was a problem hiding this comment.
probably don't need both int and round
| """Opens a recording stream as a generator yielding the audio chunks.""" | ||
| def __init__(self): | ||
| self._rate = SAMPLE_RATE | ||
| self._chunk_size = CHUNK_SIZE |
There was a problem hiding this comment.
nit: these should be passed into __init__ as arguments, possible defaulting to those global variables.
| self._bytes_per_chunk = (self._chunk_size * self._bytes_per_sample) | ||
| self._chunks_per_second = ( | ||
| self._bytes_per_second // self._bytes_per_chunk) | ||
| self._untranscribed = collections.deque( |
There was a problem hiding this comment.
it is not very easy to trace through the code to understand how this second buffer self._untranscribed is needed.
There was a problem hiding this comment.
Right, removed. Before it was holding over audio that might have failed, because it was waiting for the Error of streaming for too long, but updated to restart before that error making it's use redundant.
dizcology
left a comment
There was a problem hiding this comment.
looks good.
please explore ways of testing this.
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
* Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
* Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
* Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
) * Draft 1: indefinitely-long streaming transcription * Clean up & refactor of indefinite speech transcrib * Make sure chunks_per_second is a whole number. * Update for google-cloud-python client lib. * Update sample to not error out, but make a new request every ~60ish seconds * Update transcribe_streaming_mic.py * Clean up unnecessary code, since we no longer wait for it to error out * Update based on feedback
No description provided.