Skip to content

Add Speech Streaming usage documentation.#2483

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

Add Speech Streaming usage documentation.#2483
daspecster wants to merge 2 commits intogoogleapis: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?

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

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

Copy link
Copy Markdown
Contributor

@dhermes dhermes left a comment

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 thread docs/speech-usage.rst Outdated

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

This comment was marked as spam.

Comment thread docs/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 thread docs/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 thread docs/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 thread docs/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 thread docs/speech-usage.rst
transcript: Hello, this is one test
confidence: 0


This comment was marked as spam.

This comment was marked as spam.

Comment thread docs/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 thread docs/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
Contributor Author

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

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

Labels

api: speech Issues related to the Speech-to-Text API. 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