From 21063c0cadfae7c10cd4d4a287351fcfc35166f0 Mon Sep 17 00:00:00 2001 From: nnegrey Date: Wed, 20 Mar 2019 15:47:10 -0700 Subject: [PATCH] Move mic samples out of cloud-client so that cloud-client samples can be run in cloud shell --- speech/cloud-client/requirements.txt | 2 - speech/microphone/README.rst | 82 ++++++++++++++++++ speech/microphone/README.rst.in | 24 +++++ speech/microphone/requirements.txt | 3 + .../resources/quit.raw | Bin .../transcribe_streaming_indefinite.py | 0 .../transcribe_streaming_mic.py | 0 .../transcribe_streaming_mic_test.py | 0 8 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 speech/microphone/README.rst create mode 100644 speech/microphone/README.rst.in create mode 100644 speech/microphone/requirements.txt rename speech/{cloud-client => microphone}/resources/quit.raw (100%) rename speech/{cloud-client => microphone}/transcribe_streaming_indefinite.py (100%) rename speech/{cloud-client => microphone}/transcribe_streaming_mic.py (100%) rename speech/{cloud-client => microphone}/transcribe_streaming_mic_test.py (100%) diff --git a/speech/cloud-client/requirements.txt b/speech/cloud-client/requirements.txt index 88d0bd85cb1..e4805f68751 100644 --- a/speech/cloud-client/requirements.txt +++ b/speech/cloud-client/requirements.txt @@ -1,3 +1 @@ google-cloud-speech==0.36.3 -pyaudio==0.2.11 -six==1.12.0 diff --git a/speech/microphone/README.rst b/speech/microphone/README.rst new file mode 100644 index 00000000000..6363b5738a9 --- /dev/null +++ b/speech/microphone/README.rst @@ -0,0 +1,82 @@ +.. This file is automatically generated. Do not edit this file directly. + +Google Cloud Speech API Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=speech/microphone/README.rst + + +This directory contains samples for Google Cloud Speech API. The `Google Cloud Speech API`_ enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Cloud Speech API service. + +- See the `migration guide`_ for information about migrating to Python client library v0.27. + +.. _migration guide: https://cloud.google.com/speech/docs/python-client-migration + + + + +.. _Google Cloud Speech API: https://cloud.google.com/speech/docs/ + +Setup +------------------------------------------------------------------------------- + + +Authentication +++++++++++++++ + +This sample requires you to have authentication setup. Refer to the +`Authentication Getting Started Guide`_ for instructions on setting up +credentials for applications. + +.. _Authentication Getting Started Guide: + https://cloud.google.com/docs/authentication/getting-started + +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ + + + +The client library +------------------------------------------------------------------------------- + +This sample uses the `Google Cloud Client Library for Python`_. +You can read the documentation for more details on API usage and use GitHub +to `browse the source`_ and `report issues`_. + +.. _Google Cloud Client Library for Python: + https://googlecloudplatform.github.io/google-cloud-python/ +.. _browse the source: + https://github.com/GoogleCloudPlatform/google-cloud-python +.. _report issues: + https://github.com/GoogleCloudPlatform/google-cloud-python/issues + + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/speech/microphone/README.rst.in b/speech/microphone/README.rst.in new file mode 100644 index 00000000000..11831cca2df --- /dev/null +++ b/speech/microphone/README.rst.in @@ -0,0 +1,24 @@ +# This file is used to generate README.rst + +product: + name: Google Cloud Speech API + short_name: Cloud Speech API + url: https://cloud.google.com/speech/docs/ + description: > + The `Google Cloud Speech API`_ enables easy integration of Google speech + recognition technologies into developer applications. Send audio and receive + a text transcription from the Cloud Speech API service. + + + - See the `migration guide`_ for information about migrating to Python client library v0.27. + + + .. _migration guide: https://cloud.google.com/speech/docs/python-client-migration + +setup: +- auth +- install_deps + +cloud_client_library: true + +folder: speech/microphone \ No newline at end of file diff --git a/speech/microphone/requirements.txt b/speech/microphone/requirements.txt new file mode 100644 index 00000000000..88d0bd85cb1 --- /dev/null +++ b/speech/microphone/requirements.txt @@ -0,0 +1,3 @@ +google-cloud-speech==0.36.3 +pyaudio==0.2.11 +six==1.12.0 diff --git a/speech/cloud-client/resources/quit.raw b/speech/microphone/resources/quit.raw similarity index 100% rename from speech/cloud-client/resources/quit.raw rename to speech/microphone/resources/quit.raw diff --git a/speech/cloud-client/transcribe_streaming_indefinite.py b/speech/microphone/transcribe_streaming_indefinite.py similarity index 100% rename from speech/cloud-client/transcribe_streaming_indefinite.py rename to speech/microphone/transcribe_streaming_indefinite.py diff --git a/speech/cloud-client/transcribe_streaming_mic.py b/speech/microphone/transcribe_streaming_mic.py similarity index 100% rename from speech/cloud-client/transcribe_streaming_mic.py rename to speech/microphone/transcribe_streaming_mic.py diff --git a/speech/cloud-client/transcribe_streaming_mic_test.py b/speech/microphone/transcribe_streaming_mic_test.py similarity index 100% rename from speech/cloud-client/transcribe_streaming_mic_test.py rename to speech/microphone/transcribe_streaming_mic_test.py