diff --git a/texttospeech/ssml_addresses/resources/example.ssml b/texttospeech/cloud-client/resources/example.ssml similarity index 100% rename from texttospeech/ssml_addresses/resources/example.ssml rename to texttospeech/cloud-client/resources/example.ssml diff --git a/texttospeech/ssml_addresses/resources/example.txt b/texttospeech/cloud-client/resources/example.txt similarity index 100% rename from texttospeech/ssml_addresses/resources/example.txt rename to texttospeech/cloud-client/resources/example.txt diff --git a/texttospeech/ssml_addresses/tts.py b/texttospeech/cloud-client/ssml_addresses.py similarity index 100% rename from texttospeech/ssml_addresses/tts.py rename to texttospeech/cloud-client/ssml_addresses.py diff --git a/texttospeech/ssml_addresses/tts_test.py b/texttospeech/cloud-client/ssml_addresses_test.py similarity index 81% rename from texttospeech/ssml_addresses/tts_test.py rename to texttospeech/cloud-client/ssml_addresses_test.py index 992200d144f1..0c4e810e76a2 100644 --- a/texttospeech/ssml_addresses/tts_test.py +++ b/texttospeech/cloud-client/ssml_addresses_test.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from tts import text_to_ssml -from tts import ssml_to_audio +from ssml_addresses import text_to_ssml +from ssml_addresses import ssml_to_audio import filecmp import os @@ -39,16 +39,11 @@ def test_ssml_to_audio(capsys): # Assert audio file generated ssml_to_audio(input_ssml, 'test_example.mp3') - assert os.path.isfile('test_example.mp3') - - # Assert audio file generated correctly - assert filecmp.cmp('test_example.mp3', - 'resources/expected_example.mp3', - shallow=True) out, err = capsys.readouterr() - # Delete test file - os.remove("test_example.mp3") - - # Assert success message printed + # Assert MP3 file created + assert os.path.isfile('test_example.mp3') assert "Audio content written to file test_example.mp3" in out + + # Delete MP3 test file + os.remove("test_example.mp3") diff --git a/texttospeech/ssml_addresses/README.rst b/texttospeech/ssml_addresses/README.rst deleted file mode 100644 index b009f2361563..000000000000 --- a/texttospeech/ssml_addresses/README.rst +++ /dev/null @@ -1,97 +0,0 @@ -.. This file is automatically generated. Do not edit this file directly. - -Google Cloud Text-to-Speech API 'Speaking Addresses with SSML' Tutorial 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=/README.rst - - -This directory contains samples for Google Cloud Text-to-Speech API 'Speaking Addresses with SSML' Tutorial. Google Cloud Text-To-Speech API 'Speaking Addresses with SSML Tutorial'_ enables you to use Speech Synthesis Markup Language (SSML) to speak a text file of addresses. You can embed SSML commands in a string of text to personalize synthetic audio from Cloud Text-to-Speech API. - - - - -.. _Google Cloud Text-to-Speech API 'Speaking Addresses with SSML' Tutorial: https://cloud.google.com/text-to-speech/docs/ssml-tutorial - -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/ - -Samples -------------------------------------------------------------------------------- - -Speaking addresses with SSML Tutorial -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -.. 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=/tts.py,/README.rst - - - - -To run this sample: - -.. code-block:: bash - - $ python tts.py - - - - -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/texttospeech/ssml_addresses/README.rst.in b/texttospeech/ssml_addresses/README.rst.in deleted file mode 100644 index e8e55fec3f58..000000000000 --- a/texttospeech/ssml_addresses/README.rst.in +++ /dev/null @@ -1,19 +0,0 @@ - -# This file is used to generate README.rst - -product: - name: Google Cloud Text-to-Speech API 'Speaking Addresses with SSML' Tutorial - short_name: Cloud TTS API SSML Addresses Tutorial - url: https://cloud.google.com/text-to-speech/docs/ssml-tutorial - description: > - Google Cloud Text-To-Speech API 'Speaking Addresses with SSML Tutorial'_ enables you to use Speech Synthesis Markup Language (SSML) to speak a text file of addresses. You can embed SSML commands in a string of text to personalize synthetic audio from Cloud Text-to-Speech API. - -setup: -- auth -- install_deps - -samples: -- name: Speaking addresses with SSML Tutorial - file: tts.py - -cloud_client_library: true \ No newline at end of file diff --git a/texttospeech/ssml_addresses/requirements.txt b/texttospeech/ssml_addresses/requirements.txt deleted file mode 100644 index 9b2ccbe9d2ad..000000000000 --- a/texttospeech/ssml_addresses/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -google-cloud-texttospeech==0.4.0 \ No newline at end of file diff --git a/texttospeech/ssml_addresses/resources/expected_example.mp3 b/texttospeech/ssml_addresses/resources/expected_example.mp3 deleted file mode 100644 index efa38a1428ec..000000000000 Binary files a/texttospeech/ssml_addresses/resources/expected_example.mp3 and /dev/null differ