-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add word time offset samples #1050
Conversation
Change-Id: Icdceae36f2c702eddd59e9fe4eb04155ef248cb6
end_time.seconds + end_time.nanos * 1e-9)) | ||
|
||
|
||
# [START def_transcribe_gcs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transcribe_file_with_word_time_offsets
function doesn't use a region tag but this does. Ignore comment if that's how Python often does samples!
If using region tags, the GCS tag is: speech_async_recognize_gcs_words
Again, if you normally use def_...
region tags, then all good!
I'm guessing that we should embed these snippets using indented region for transcribe_file_with_word_time_offsets
but region rag for def_transcribe_gcs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the ranges of indented blocks and region tags overlap then sometimes the code blocks would be incorrectly displayed in the include code widget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indented_block="def function_name"
is the preferred way for Python samples if the entire body of the function will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how that would be an issue for these samples.
|
||
Example usage: | ||
python transcribe_word_time_offsets.py resources/audio.raw | ||
python transcribe_word_time_offsets.py gs://cloud-samples-tests/speech/vr.flac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional/Nit: the sample hardcodes LINEAR16 so Flac audio won't work.
(This has come up when people have tried to use the sample)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests use the flac audio and pass. No idea why that's the case, but this seems like a non-issue.
No description provided.