Skip to content
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

Merged
merged 1 commit into from
Aug 3, 2017
Merged

Add word time offset samples #1050

merged 1 commit into from
Aug 3, 2017

Conversation

theacodes
Copy link
Contributor

No description provided.

Change-Id: Icdceae36f2c702eddd59e9fe4eb04155ef248cb6
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 3, 2017
end_time.seconds + end_time.nanos * 1e-9))


# [START def_transcribe_gcs]
Copy link
Contributor

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@theacodes theacodes merged commit b92890a into master Aug 3, 2017
@theacodes theacodes deleted the speech-word-offsets branch August 3, 2017 23:01
busunkim96 pushed a commit to busunkim96/python-speech that referenced this pull request Sep 1, 2020
busunkim96 pushed a commit to googleapis/python-speech that referenced this pull request Sep 3, 2020
telpirion pushed a commit that referenced this pull request Jan 13, 2023
dandhlee pushed a commit that referenced this pull request Feb 9, 2023
telpirion pushed a commit that referenced this pull request Mar 13, 2023
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 6, 2023
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 6, 2023
atulep pushed a commit to googleapis/google-cloud-python that referenced this pull request Apr 18, 2023
parthea pushed a commit to googleapis/google-cloud-python that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants