Skip to content

Add Speech Streaming usage documentation. - #2483

Closed
daspecster wants to merge 2 commits into
googleapis:masterfrom
daspecster:speech-streaming
Closed

Add Speech Streaming usage documentation.#2483
daspecster wants to merge 2 commits into
googleapis:masterfrom
daspecster:speech-streaming

Conversation

@daspecster

Copy link
Copy Markdown
Contributor

Speech streaming has some implications to it that I think could be good to talk about.

  • What kind of inputs should we support or is just a file correct for now?
  • Should a context manager be used outside of the client or in the client.stream_recognize() method itself?
  • If interum_results is True, should we yield the results as we receive them?

@daspecsterdaspecster added docs api: speech Issues related to the Speech-to-Text API. labels Oct 3, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 3, 2016
@daspecster

Copy link
Copy Markdown
ContributorAuthor

@tseaver@dhermes LMK if you have any feedback for this. I updated it with the changes from #2495.

@dhermesdhermes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My nits aren't really with these docs, they are with the implementation. WDYT?

Comment threaddocs/speech-usage.rst Outdated

>>> results = client.stream_recognize('hello.flac', 'FLAC', 44100,
... interim_results=True)
>>> print results

This comment was marked as spam.

Comment threaddocs/speech-usage.rst
0.96976006031

For continuous speech containing more than one word, the ``single_utterance``
option should be disabled.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst Outdated

>>> from google.cloud import speech
>>> client = speech.Client()
>>> results = client.stream_recognize('hello.flac', 'FLAC', 44100)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst
>>> results[2].alternatives[0].transcript
hello
>>> results[2].alternatives[0].confidence
0.96976006031

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst Outdated
}
is_final: true
}
]

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst
transcript: Hello, this is one test
confidence: 0


This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst
>>> sample = client.sample(source_uri='gs://my-bucket/recording.flac',
... encoding=Encoding.FLAC,
... sample_rate=44100)
>>> results = client.stream_recognize(sample, single_utterance=False)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment threaddocs/speech-usage.rst
... encoding=Encoding.FLAC,
... sample_rate=44100)
>>> results = client.stream_recognize(sample, interim_results=True)
>>> print results[0].alternatives.transcript

This comment was marked as spam.

@daspecster

Copy link
Copy Markdown
ContributorAuthor

I'm going to close this and make a new PR with the whole shebang.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: speechIssues related to the Speech-to-Text API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@daspecster@dhermes@tseaver@googlebot