| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| The :meth:`~google.cloud.speech.Client.sync_recognize` method converts speech | ||
| data to text and returns alternative text transcriptons. | ||
|
|
||
| This example uses ``language_code='en-GB'`` to better recognize a dialect from |
There was a problem hiding this comment.
Looks mostly good. Assuming tests are green, these changes should be easy to make / uncontroversial.
Sorry, something went wrong.
| ... None, 'gs://my-bucket/recording.flac', | ||
| ... 'FLAC', 16000, max_alternatives=2) | ||
| ... 'FLAC', 16000, source_uri='gs://my-bucket/recording.flac', | ||
| ... language_code='en-GB', max_alternatives=2, ) |
| ... print('transcript: ' + alternative['transcript']) | ||
| ... print('confidence: ' + alternative['confidence']) | ||
| ==================== | ||
| transcript: Hello, this is a f****** test |
| _connection_class = Connection | ||
|
|
||
| def async_recognize(self, content, source_uri, encoding, sample_rate, | ||
| def async_recognize(self, encoding, sample_rate, content=None, |
| re-sampling). | ||
|
|
||
| :type content: bytes | ||
| :param content: Byte stream of audio. |
| omitted, profanities won't be filtered out. | ||
|
|
||
| :type source_uri: str | ||
| :param source_uri: URI that points to a file that contains audio |
Sorry, something went wrong.
Sorry, something went wrong.
|
@dhermes was there anything else on this? |
Sorry, something went wrong.
| """Google Cloud Speech API wrapper.""" | ||
|
|
||
| from google.cloud.speech.client import Client | ||
| from google.cloud.speech.client import Encoding |
|
@daspecster I haven't followed since @tseaver requested the Sample class. If he is OK with the changes I am OK with them. |
Sorry, something went wrong.
There was a problem hiding this comment.
The change to the Sample class LGTM. Do we need to add a Client.sample() factory (basically to ease the developer's need to do extra imports).
Sorry, something went wrong.
|
@tseaver I think you may have eluded to that in your sample and I didn't make the connection so I took that out. I'll add that and push it back up. |
Sorry, something went wrong.
|
@tseaver added the @staticmethod on speech.client.Client. LMKWYT! |
Sorry, something went wrong.
Updates from googleapis#2344 for speech API.
| Back | FazBrowse Home | New Git URL |
See: #2344 (comment)