From 2ca04004f3dcaf1727ffb3331c4327aa4e7be429 Mon Sep 17 00:00:00 2001 From: Noah Negrey Date: Mon, 26 Mar 2018 14:47:37 -0700 Subject: [PATCH 01/65] Add text-to-speech beta samples [(#1421)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1421) --- texttospeech/snippets/README.rst | 167 ++++++++++++++++++ texttospeech/snippets/README.rst.in | 26 +++ texttospeech/snippets/list_voices.py | 56 ++++++ texttospeech/snippets/list_voices_test.py | 23 +++ texttospeech/snippets/quickstart.py | 62 +++++++ texttospeech/snippets/requirements.txt | 1 + texttospeech/snippets/resources/hello.ssml | 1 + texttospeech/snippets/resources/hello.txt | 1 + texttospeech/snippets/synthesize_file.py | 102 +++++++++++ texttospeech/snippets/synthesize_file_test.py | 37 ++++ texttospeech/snippets/synthesize_text.py | 100 +++++++++++ texttospeech/snippets/synthesize_text_test.py | 37 ++++ 12 files changed, 613 insertions(+) create mode 100644 texttospeech/snippets/README.rst create mode 100644 texttospeech/snippets/README.rst.in create mode 100644 texttospeech/snippets/list_voices.py create mode 100644 texttospeech/snippets/list_voices_test.py create mode 100644 texttospeech/snippets/quickstart.py create mode 100644 texttospeech/snippets/requirements.txt create mode 100644 texttospeech/snippets/resources/hello.ssml create mode 100644 texttospeech/snippets/resources/hello.txt create mode 100644 texttospeech/snippets/synthesize_file.py create mode 100644 texttospeech/snippets/synthesize_file_test.py create mode 100644 texttospeech/snippets/synthesize_text.py create mode 100644 texttospeech/snippets/synthesize_text_test.py diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst new file mode 100644 index 000000000000..a917784c2c97 --- /dev/null +++ b/texttospeech/snippets/README.rst @@ -0,0 +1,167 @@ +.. This file is automatically generated. Do not edit this file directly. + +Google Cloud Text-to-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=/README.rst + + +This directory contains samples for Google Cloud Text-to-Speech API. The `Google Cloud Text To Speech API`_ enables you to generate and customize synthesized speech from text or SSML. + + + + +.. _Google Cloud Text-to-Speech API: https://cloud.google.com/text-to-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 +++++++++++++++++++++ + +#. 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 +------------------------------------------------------------------------------- + +Quickstart ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. 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=/quickstart.py;/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python quickstart.py + + +List voices ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. 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=/list_voices.py;/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python list_voices.py + + +Synthesize text ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. 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=/synthesize_text.py;/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python synthesize_text.py + + usage: synthesize_text.py [-h] (--text TEXT | --ssml SSML) + + Google Cloud Text-To-Speech API sample application . + + Example usage: + python synthesize_text.py --text "hello" + python synthesize_text.py --ssml "Hello there." + + optional arguments: + -h, --help show this help message and exit + --text TEXT The text from which to synthesize speech. + --ssml SSML The ssml string from which to synthesize speech. + + + +Synthesize file ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. 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=/synthesize_file.py;/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python synthesize_file.py + + usage: synthesize_file.py [-h] (--text TEXT | --ssml SSML) + + Google Cloud Text-To-Speech API sample application . + + Example usage: + python synthesize_file.py --text resources/hello.txt + python synthesize_file.py --ssml resources/hello.ssml + + optional arguments: + -h, --help show this help message and exit + --text TEXT The text file from which to synthesize speech. + --ssml SSML The ssml file from which to synthesize speech. + + + + + +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/snippets/README.rst.in b/texttospeech/snippets/README.rst.in new file mode 100644 index 000000000000..e0cee2957598 --- /dev/null +++ b/texttospeech/snippets/README.rst.in @@ -0,0 +1,26 @@ +# This file is used to generate README.rst + +product: + name: Google Cloud Text-to-Speech API + short_name: Cloud TTS API + url: https://cloud.google.com/text-to-speech/docs/ + description: > + The `Google Cloud Text To Speech API`_ enables you to generate and customize synthesized speech from text or SSML. + +setup: +- auth +- install_deps + +samples: +- name: Quickstart + file: quickstart.py +- name: List voices + file: list_voices.py +- name: Synthesize text + file: synthesize_text.py + show_help: True +- name: Synthesize file + file: synthesize_file.py + show_help: True + +cloud_client_library: true diff --git a/texttospeech/snippets/list_voices.py b/texttospeech/snippets/list_voices.py new file mode 100644 index 000000000000..3f43499c6742 --- /dev/null +++ b/texttospeech/snippets/list_voices.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Google Cloud Text-To-Speech API sample application. + +Example usage: + python list_voices.py +""" + + +# [START tts_list_voices] +def list_voices(): + """Lists the available voices.""" + from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() + + # Performs the list voices request + voices = client.list_voices() + + for voice in voices.voices: + # Display the voice's name. Example: tpc-vocoded + print('Name: {}'.format(voice.name)) + + # Display the supported language codes for this voice. Example: "en-US" + for language_code in voice.language_codes: + print('Supported language: {}'.format(language_code)) + + # SSML Voice Gender values from google.cloud.texttospeech.enums + ssml_voice_genders = ['SSML_VOICE_GENDER_UNSPECIFIED', 'MALE', + 'FEMALE', 'NEUTRAL'] + + # Display the SSML Voice Gender + print('SSML Voice Gender: {}'.format( + ssml_voice_genders[voice.ssml_gender])) + + # Display the natural sample rate hertz for this voice. Example: 24000 + print('Natural Sample Rate Hertz: {}\n'.format( + voice.natural_sample_rate_hertz)) +# [END tts_list_voices] + + +if __name__ == '__main__': + list_voices() diff --git a/texttospeech/snippets/list_voices_test.py b/texttospeech/snippets/list_voices_test.py new file mode 100644 index 000000000000..fd3255694922 --- /dev/null +++ b/texttospeech/snippets/list_voices_test.py @@ -0,0 +1,23 @@ +# Copyright 2018, Google, Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import list_voices + + +def test_list_voices(capsys): + list_voices.list_voices() + out, err = capsys.readouterr() + + assert 'en-US' in out + assert 'SSML Voice Gender: MALE' in out + assert 'SSML Voice Gender: FEMALE' in out diff --git a/texttospeech/snippets/quickstart.py b/texttospeech/snippets/quickstart.py new file mode 100644 index 000000000000..f462139d794b --- /dev/null +++ b/texttospeech/snippets/quickstart.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Google Cloud Text-To-Speech API sample application . + +Example usage: + python quickstart.py +""" + + +def run_quickstart(): + # [START tts_quickstart] + """Synthesizes speech from the input string of text or ssml. + + Note: ssml must be well-formed according to: + https://www.w3.org/TR/speech-synthesis/ + """ + from google.cloud import texttospeech + + # Instantiates a client + client = texttospeech.TextToSpeechClient() + + # Set the text input to be synthesized + synthesis_input = texttospeech.types.SynthesisInput(text="Hello, World!") + + # Build the voice request, select the language code ("en-US") and the ssml + # voice gender ("neutral") + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.NEUTRAL) + + # Select the type of audio file you want returned + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + # Perform the text-to-speech request on the text input with the selected + # voice parameters and audio file type + response = client.synthesize_speech(synthesis_input, voice, audio_config) + + # The response's audio_content is binary. + with open('output.mp3', 'wb') as out: + # Write the response to the output file. + out.write(response.audio_content) + print('Audio content written to file "output.mp3"') + # [END tts_quickstart] + + +if __name__ == '__main__': + run_quickstart() diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt new file mode 100644 index 000000000000..4fd188de7402 --- /dev/null +++ b/texttospeech/snippets/requirements.txt @@ -0,0 +1 @@ +google-cloud-texttospeech==0.1.0 diff --git a/texttospeech/snippets/resources/hello.ssml b/texttospeech/snippets/resources/hello.ssml new file mode 100644 index 000000000000..cd347b71fe58 --- /dev/null +++ b/texttospeech/snippets/resources/hello.ssml @@ -0,0 +1 @@ +Hello there. \ No newline at end of file diff --git a/texttospeech/snippets/resources/hello.txt b/texttospeech/snippets/resources/hello.txt new file mode 100644 index 000000000000..cd773cd131fc --- /dev/null +++ b/texttospeech/snippets/resources/hello.txt @@ -0,0 +1 @@ +Hello there! \ No newline at end of file diff --git a/texttospeech/snippets/synthesize_file.py b/texttospeech/snippets/synthesize_file.py new file mode 100644 index 000000000000..f62d6330d7d5 --- /dev/null +++ b/texttospeech/snippets/synthesize_file.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python + +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Google Cloud Text-To-Speech API sample application . + +Example usage: + python synthesize_file.py --text resources/hello.txt + python synthesize_file.py --ssml resources/hello.ssml +""" + +import argparse + + +# [START tts_synthesize_text_file] +def synthesize_text_file(text_file): + """Synthesizes speech from the input file of text.""" + from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() + + with open(text_file, 'r') as f: + text = f.read() + input_text = texttospeech.types.SynthesisInput(text=text) + + # Note: the voice can also be specified by name. + # Names of voices can be retrieved with client.list_voices(). + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + response = client.synthesize_speech(input_text, voice, audio_config) + + # The response's audio_content is binary. + with open('output.mp3', 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file "output.mp3"') +# [END tts_synthesize_text_file] + + +# [START tts_synthesize_ssml_file] +def synthesize_ssml_file(ssml_file): + """Synthesizes speech from the input file of ssml. + + Note: ssml must be well-formed according to: + https://www.w3.org/TR/speech-synthesis/ + """ + from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() + + with open(ssml_file, 'r') as f: + ssml = f.read() + input_text = texttospeech.types.SynthesisInput(ssml=ssml) + + # Note: the voice can also be specified by name. + # Names of voices can be retrieved with client.list_voices(). + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + response = client.synthesize_speech(input_text, voice, audio_config) + + # The response's audio_content is binary. + with open('output.mp3', 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file "output.mp3"') +# [END tts_synthesize_ssml_file] + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--text', + help='The text file from which to synthesize speech.') + group.add_argument('--ssml', + help='The ssml file from which to synthesize speech.') + + args = parser.parse_args() + + if args.text: + synthesize_text_file(args.text) + else: + synthesize_ssml_file(args.ssml) diff --git a/texttospeech/snippets/synthesize_file_test.py b/texttospeech/snippets/synthesize_file_test.py new file mode 100644 index 000000000000..2652009f98b6 --- /dev/null +++ b/texttospeech/snippets/synthesize_file_test.py @@ -0,0 +1,37 @@ +# Copyright 2018, Google, Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import synthesize_file + +TEXT_FILE = 'resources/hello.txt' +SSML_FILE = 'resources/hello.ssml' + + +def test_synthesize_text_file(capsys): + synthesize_file.synthesize_text_file(text_file=TEXT_FILE) + out, err = capsys.readouterr() + + assert 'Audio content written to file' in out + statinfo = os.stat('output.mp3') + assert statinfo.st_size > 0 + + +def test_synthesize_ssml_file(capsys): + synthesize_file.synthesize_ssml_file(ssml_file=SSML_FILE) + out, err = capsys.readouterr() + + assert 'Audio content written to file' in out + statinfo = os.stat('output.mp3') + assert statinfo.st_size > 0 diff --git a/texttospeech/snippets/synthesize_text.py b/texttospeech/snippets/synthesize_text.py new file mode 100644 index 000000000000..d5886bd16f15 --- /dev/null +++ b/texttospeech/snippets/synthesize_text.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +# Copyright 2018 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Google Cloud Text-To-Speech API sample application . + +Example usage: + python synthesize_text.py --text "hello" + python synthesize_text.py --ssml "Hello there." +""" + +import argparse + + +# [START tts_synthesize_text] +def synthesize_text(text): + """Synthesizes speech from the input string of text.""" + from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() + + input_text = texttospeech.types.SynthesisInput(text=text) + + # Note: the voice can also be specified by name. + # Names of voices can be retrieved with client.list_voices(). + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + response = client.synthesize_speech(input_text, voice, audio_config) + + # The response's audio_content is binary. + with open('output.mp3', 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file "output.mp3"') +# [END tts_synthesize_text] + + +# [START tts_synthesize_ssml] +def synthesize_ssml(ssml): + """Synthesizes speech from the input string of ssml. + + Note: ssml must be well-formed according to: + https://www.w3.org/TR/speech-synthesis/ + + Example: Hello there. + """ + from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() + + input_text = texttospeech.types.SynthesisInput(ssml=ssml) + + # Note: the voice can also be specified by name. + # Names of voices can be retrieved with client.list_voices(). + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + response = client.synthesize_speech(input_text, voice, audio_config) + + # The response's audio_content is binary. + with open('output.mp3', 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file "output.mp3"') +# [END tts_synthesize_ssml] + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--text', + help='The text from which to synthesize speech.') + group.add_argument('--ssml', + help='The ssml string from which to synthesize speech.') + + args = parser.parse_args() + + if args.text: + synthesize_text(args.text) + else: + synthesize_ssml(args.ssml) diff --git a/texttospeech/snippets/synthesize_text_test.py b/texttospeech/snippets/synthesize_text_test.py new file mode 100644 index 000000000000..948d58da26df --- /dev/null +++ b/texttospeech/snippets/synthesize_text_test.py @@ -0,0 +1,37 @@ +# Copyright 2018, Google, Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +import synthesize_text + +TEXT = 'Hello there.' +SSML = 'Hello there.' + + +def test_synthesize_text(capsys): + synthesize_text.synthesize_text(text=TEXT) + out, err = capsys.readouterr() + + assert 'Audio content written to file' in out + statinfo = os.stat('output.mp3') + assert statinfo.st_size > 0 + + +def test_synthesize_ssml(capsys): + synthesize_text.synthesize_ssml(ssml=SSML) + out, err = capsys.readouterr() + + assert 'Audio content written to file' in out + statinfo = os.stat('output.mp3') + assert statinfo.st_size > 0 From 768a102ef8779e28d1031ae30b32e9d5a346170f Mon Sep 17 00:00:00 2001 From: chenyumic Date: Fri, 6 Apr 2018 22:57:36 -0700 Subject: [PATCH 02/65] Regenerate the README files and fix the Open in Cloud Shell link for some samples [(#1441)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1441) --- texttospeech/snippets/README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst index a917784c2c97..c7349a722f6e 100644 --- a/texttospeech/snippets/README.rst +++ b/texttospeech/snippets/README.rst @@ -59,7 +59,7 @@ Quickstart +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. 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=/quickstart.py;/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/quickstart.py,/README.rst @@ -75,7 +75,7 @@ List voices +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. 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=/list_voices.py;/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/list_voices.py,/README.rst @@ -91,7 +91,7 @@ Synthesize text +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. 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=/synthesize_text.py;/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/synthesize_text.py,/README.rst @@ -121,7 +121,7 @@ Synthesize file +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. 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=/synthesize_file.py;/README.rst + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=/synthesize_file.py,/README.rst From e68eaed1e47c8a322734003373fb89b74c869403 Mon Sep 17 00:00:00 2001 From: Frank Natividad Date: Thu, 26 Apr 2018 10:26:41 -0700 Subject: [PATCH 03/65] Update READMEs to fix numbering and add git clone [(#1464)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1464) --- texttospeech/snippets/README.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst index c7349a722f6e..af599fb0a928 100644 --- a/texttospeech/snippets/README.rst +++ b/texttospeech/snippets/README.rst @@ -31,10 +31,16 @@ credentials for applications. 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 + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup #. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. From 59640bb8a211c32a9e0570ade96962988a1c76f2 Mon Sep 17 00:00:00 2001 From: Noah Negrey Date: Thu, 14 Jun 2018 16:42:35 -0700 Subject: [PATCH 04/65] Update library to GA [(#1523)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1523) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 4fd188de7402..597306701eca 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.1.0 +google-cloud-texttospeech==0.2.0 From 79e59081b41840fa870ece85506c97d52314850c Mon Sep 17 00:00:00 2001 From: Noah Negrey Date: Fri, 22 Jun 2018 14:04:01 -0700 Subject: [PATCH 05/65] Rollback Changes [(#1539)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1539) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 597306701eca..4fd188de7402 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.2.0 +google-cloud-texttospeech==0.1.0 From 1cd3eedda7690c278fb5a53665b50395ff8fa46b Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Wed, 27 Jun 2018 08:20:03 -0700 Subject: [PATCH 06/65] Fixes link render typo [(#1545)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1545) --- texttospeech/snippets/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst index af599fb0a928..463b006ae856 100644 --- a/texttospeech/snippets/README.rst +++ b/texttospeech/snippets/README.rst @@ -7,7 +7,7 @@ Google Cloud Text-to-Speech API Python Samples :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. The `Google Cloud Text To Speech API`_ enables you to generate and customize synthesized speech from text or SSML. +This directory contains samples for Google Cloud Text-to-Speech API. The `Google Cloud Text-to-Speech API`_ enables you to generate and customize synthesized speech from text or SSML. @@ -170,4 +170,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file +.. _Google Cloud SDK: https://cloud.google.com/sdk/ From b04675d5d1542d82ab0fc70563f963f7385638ec Mon Sep 17 00:00:00 2001 From: Shahin Date: Thu, 12 Jul 2018 14:11:55 -0700 Subject: [PATCH 07/65] [DO NOT MERGE] Added Audio Profile sample [(#1538)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1538) * Added Audio Profile sample * Adjusted the row lengths * Adjusted the row length * Fixed Import orders * Fixed print statement * Debugging the unit test * Fixed the unit test * Some fixes per Noah's suggestions. * Renamed the function name in the test. * Multilined the long line. * Fixed the misspelling * Fixed the long line * Forcing the CicleCi to build again * Changing Inc to LLC * Updated library version. * Generated README.rst --- texttospeech/snippets/README.rst | 37 ++++++++++- texttospeech/snippets/README.rst.in | 3 + texttospeech/snippets/audio_profile.py | 70 +++++++++++++++++++++ texttospeech/snippets/audio_profile_test.py | 34 ++++++++++ texttospeech/snippets/requirements.txt | 2 +- 5 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 texttospeech/snippets/audio_profile.py create mode 100644 texttospeech/snippets/audio_profile_test.py diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst index 463b006ae856..7b877be1328b 100644 --- a/texttospeech/snippets/README.rst +++ b/texttospeech/snippets/README.rst @@ -7,7 +7,7 @@ Google Cloud Text-to-Speech API Python Samples :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. The `Google Cloud Text-to-Speech API`_ enables you to generate and customize synthesized speech from text or SSML. +This directory contains samples for Google Cloud Text-to-Speech API. The `Google Cloud Text To Speech API`_ enables you to generate and customize synthesized speech from text or SSML. @@ -153,6 +153,39 @@ To run this sample: +Audio profile ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. 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=/audio_profile.py,/README.rst + + + + +To run this sample: + +.. code-block:: bash + + $ python audio_profile.py + + usage: audio_profile.py [-h] [--output OUTPUT] [--text TEXT] + [--effects_profile_id EFFECTS_PROFILE_ID] + + Google Cloud Text-To-Speech API sample application for audio profile. + + Example usage: + python audio_profile.py --text "hello" --effects_profile_id + "telephony-class-application" + + optional arguments: + -h, --help show this help message and exit + --output OUTPUT The output mp3 file. + --text TEXT The text from which to synthesize speech. + --effects_profile_id EFFECTS_PROFILE_ID + The audio effects profile id to be applied. + + + The client library @@ -170,4 +203,4 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/texttospeech/snippets/README.rst.in b/texttospeech/snippets/README.rst.in index e0cee2957598..8be6ab467741 100644 --- a/texttospeech/snippets/README.rst.in +++ b/texttospeech/snippets/README.rst.in @@ -22,5 +22,8 @@ samples: - name: Synthesize file file: synthesize_file.py show_help: True +- name: Audio profile + file: audio_profile.py + show_help: True cloud_client_library: true diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py new file mode 100644 index 000000000000..c616f7100267 --- /dev/null +++ b/texttospeech/snippets/audio_profile.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python + +# Copyright 2018 Google LLC. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Google Cloud Text-To-Speech API sample application for audio profile. + +Example usage: + python audio_profile.py --text "hello" --effects_profile_id + "telephony-class-application" +""" + +import argparse + + +# [START tts_synthesize_text_with_audio_profile] +def synthesize_text_with_audio_profile(text, output, effects_profile_id): + """Synthesizes speech from the input string of text.""" + from google.cloud import texttospeech_v1beta1 as texttospeech + + client = texttospeech.TextToSpeechClient() + + input_text = texttospeech.types.SynthesisInput(text=text) + + # Note: the voice can also be specified by name. + # Names of voices can be retrieved with client.list_voices(). + voice = texttospeech.types.VoiceSelectionParams(language_code='en-US') + + # Note: you can pass in multiple effects_profile_id. They will be applied + # in the same order they are provided. + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3, + effects_profile_id=[effects_profile_id]) + + response = client.synthesize_speech(input_text, voice, audio_config) + + # The response's audio_content is binary. + with open(output, 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file "%s"' % output) + +# [END tts_synthesize_text_with_audio_profile] + + +if __name__ == '__main__': + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--output', + help='The output mp3 file.') + parser.add_argument('--text', + help='The text from which to synthesize speech.') + parser.add_argument('--effects_profile_id', + help='The audio effects profile id to be applied.') + + args = parser.parse_args() + + synthesize_text_with_audio_profile(args.text, args.output, + args.effects_profile_id) diff --git a/texttospeech/snippets/audio_profile_test.py b/texttospeech/snippets/audio_profile_test.py new file mode 100644 index 000000000000..43a30bf06d16 --- /dev/null +++ b/texttospeech/snippets/audio_profile_test.py @@ -0,0 +1,34 @@ +# Copyright 2018, Google, LLC. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import os.path + +import audio_profile + +TEXT = 'hello' +OUTPUT = 'output.mp3' +EFFECTS_PROFILE_ID = 'telephony-class-application' + + +def test_audio_profile(capsys): + if os.path.exists(OUTPUT): + os.remove(OUTPUT) + assert not os.path.exists(OUTPUT) + audio_profile.synthesize_text_with_audio_profile(TEXT, OUTPUT, + EFFECTS_PROFILE_ID) + out, err = capsys.readouterr() + + assert ('Audio content written to file "%s"' % OUTPUT) in out + assert os.path.exists(OUTPUT) + os.remove(OUTPUT) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 4fd188de7402..597306701eca 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.1.0 +google-cloud-texttospeech==0.2.0 From 9189e6675d05afd49cb43fec5eaf6493499589af Mon Sep 17 00:00:00 2001 From: Shahin Date: Fri, 20 Jul 2018 16:20:29 -0700 Subject: [PATCH 08/65] Diarization Output Modified [(#1586)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1586) * Printing the last paragraph only. * Python3 print * Removing sample rate setting * Adding the missing output parameter in the example * Changes based on the comments * Removed filenames as input parameters * Removed unused args * Updated README file * Updated the inline comment * Modified code to make it more readable * Simplified the response object processing. * Fixing the long line issue. --- texttospeech/snippets/audio_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py index c616f7100267..21a6515b4c51 100644 --- a/texttospeech/snippets/audio_profile.py +++ b/texttospeech/snippets/audio_profile.py @@ -18,7 +18,7 @@ Example usage: python audio_profile.py --text "hello" --effects_profile_id - "telephony-class-application" + "telephony-class-application" --output "output.mp3" """ import argparse From aafcfcc6c8f18cb615a7c08e8aba918c3b6eaab1 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Tue, 21 Aug 2018 15:59:53 -0400 Subject: [PATCH 09/65] TTS region tag update [(#1646)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1646) --- texttospeech/snippets/audio_profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py index 21a6515b4c51..4ddd9db5204a 100644 --- a/texttospeech/snippets/audio_profile.py +++ b/texttospeech/snippets/audio_profile.py @@ -24,7 +24,7 @@ import argparse -# [START tts_synthesize_text_with_audio_profile] +# [START tts_synthesize_text_audio_profile_beta] def synthesize_text_with_audio_profile(text, output, effects_profile_id): """Synthesizes speech from the input string of text.""" from google.cloud import texttospeech_v1beta1 as texttospeech @@ -50,7 +50,7 @@ def synthesize_text_with_audio_profile(text, output, effects_profile_id): out.write(response.audio_content) print('Audio content written to file "%s"' % output) -# [END tts_synthesize_text_with_audio_profile] +# [END tts_synthesize_text_audio_profile_beta] if __name__ == '__main__': From 2868c012999669b3ba460cb722327269af9c7098 Mon Sep 17 00:00:00 2001 From: Rebecca Taylor Date: Mon, 15 Oct 2018 13:53:04 -0700 Subject: [PATCH 10/65] Access Display Names of enum fields via enum object [(#1738)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1738) * Get display name of enums using IntEnum Requires updating google-cloud-language to 1.1.0 * Add note about gs://demomaker for video test files * Get display name of enums using IntEnum * Get display name of enums using IntEnum * Revert "Add note about gs://demomaker for video test files" This reverts commit 39d9bfff03201f7c6dcb38fee3856dd537ab4b62. --- texttospeech/snippets/list_voices.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/texttospeech/snippets/list_voices.py b/texttospeech/snippets/list_voices.py index 3f43499c6742..a2da5a178528 100644 --- a/texttospeech/snippets/list_voices.py +++ b/texttospeech/snippets/list_voices.py @@ -25,6 +25,7 @@ def list_voices(): """Lists the available voices.""" from google.cloud import texttospeech + from google.cloud.texttospeech import enums client = texttospeech.TextToSpeechClient() # Performs the list voices request @@ -38,13 +39,10 @@ def list_voices(): for language_code in voice.language_codes: print('Supported language: {}'.format(language_code)) - # SSML Voice Gender values from google.cloud.texttospeech.enums - ssml_voice_genders = ['SSML_VOICE_GENDER_UNSPECIFIED', 'MALE', - 'FEMALE', 'NEUTRAL'] + ssml_gender = enums.SsmlVoiceGender(voice.ssml_gender) # Display the SSML Voice Gender - print('SSML Voice Gender: {}'.format( - ssml_voice_genders[voice.ssml_gender])) + print('SSML Voice Gender: {}'.format(ssml_gender.name)) # Display the natural sample rate hertz for this voice. Example: 24000 print('Natural Sample Rate Hertz: {}\n'.format( From 0aee526ecf6bb566541d0fd5374e1a8193fb34b8 Mon Sep 17 00:00:00 2001 From: DPEBot Date: Wed, 6 Feb 2019 12:06:35 -0800 Subject: [PATCH 11/65] Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/1980) * Auto-update dependencies. * Update requirements.txt * Update requirements.txt --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 597306701eca..cb9f67240443 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.2.0 +google-cloud-texttospeech==0.3.0 From 05a82d7f5c3d7b45e6b0edd1ace17299858ab342 Mon Sep 17 00:00:00 2001 From: Noah Negrey Date: Fri, 22 Feb 2019 08:04:11 -0800 Subject: [PATCH 12/65] Update beta samples to GA [(#2008)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2008) --- texttospeech/snippets/audio_profile.py | 4 +++- texttospeech/snippets/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py index 4ddd9db5204a..01f2ba884ba3 100644 --- a/texttospeech/snippets/audio_profile.py +++ b/texttospeech/snippets/audio_profile.py @@ -24,10 +24,11 @@ import argparse +# [START tts_synthesize_text_audio_profile] # [START tts_synthesize_text_audio_profile_beta] def synthesize_text_with_audio_profile(text, output, effects_profile_id): """Synthesizes speech from the input string of text.""" - from google.cloud import texttospeech_v1beta1 as texttospeech + from google.cloud import texttospeech client = texttospeech.TextToSpeechClient() @@ -51,6 +52,7 @@ def synthesize_text_with_audio_profile(text, output, effects_profile_id): print('Audio content written to file "%s"' % output) # [END tts_synthesize_text_audio_profile_beta] +# [END tts_synthesize_text_audio_profile] if __name__ == '__main__': diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index cb9f67240443..0db01b710b9b 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.3.0 +google-cloud-texttospeech==0.4.0 From be3a50af221a63000895d0dd1a56ed0f2a7472ab Mon Sep 17 00:00:00 2001 From: Elizabeth Crowdus Date: Wed, 4 Sep 2019 12:49:28 -0500 Subject: [PATCH 13/65] fix: MP3 file test for Text-to-Speech SSML addresses [(#2378)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2378) * fix: refactored MP3 file tests * fix: moving resources to cloud-client/resources * fix: removing expected_example.mp3 --- texttospeech/snippets/resources/example.ssml | 4 + texttospeech/snippets/resources/example.txt | 3 + texttospeech/snippets/ssml_addresses.py | 112 +++++++++++++++++++ texttospeech/snippets/ssml_addresses_test.py | 49 ++++++++ 4 files changed, 168 insertions(+) create mode 100644 texttospeech/snippets/resources/example.ssml create mode 100644 texttospeech/snippets/resources/example.txt create mode 100644 texttospeech/snippets/ssml_addresses.py create mode 100644 texttospeech/snippets/ssml_addresses_test.py diff --git a/texttospeech/snippets/resources/example.ssml b/texttospeech/snippets/resources/example.ssml new file mode 100644 index 000000000000..1e20716f0dac --- /dev/null +++ b/texttospeech/snippets/resources/example.ssml @@ -0,0 +1,4 @@ +123 Street Ln, Small Town, IL 12345 USA +1 Jenny St & Number St, Tutone City, CA 86753 +1 Piazza del Fibonacci, 12358 Pisa, Italy + \ No newline at end of file diff --git a/texttospeech/snippets/resources/example.txt b/texttospeech/snippets/resources/example.txt new file mode 100644 index 000000000000..9cd7d74db361 --- /dev/null +++ b/texttospeech/snippets/resources/example.txt @@ -0,0 +1,3 @@ +123 Street Ln, Small Town, IL 12345 USA +1 Jenny St & Number St, Tutone City, CA 86753 +1 Piazza del Fibonacci, 12358 Pisa, Italy diff --git a/texttospeech/snippets/ssml_addresses.py b/texttospeech/snippets/ssml_addresses.py new file mode 100644 index 000000000000..b30cfce004f6 --- /dev/null +++ b/texttospeech/snippets/ssml_addresses.py @@ -0,0 +1,112 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# [START tts_ssml_address_imports] +from google.cloud import texttospeech + +import html +# [END tts_ssml_address_imports] + + +# [START tts_ssml_address_audio] +def ssml_to_audio(ssml_text, outfile): + # Generates SSML text from plaintext. + # + # Given a string of SSML text and an output file name, this function + # calls the Text-to-Speech API. The API returns a synthetic audio + # version of the text, formatted according to the SSML commands. This + # function saves the synthetic audio to the designated output file. + # + # Args: + # ssml_text: string of SSML text + # outfile: string name of file under which to save audio output + # + # Returns: + # nothing + + # Instantiates a client + client = texttospeech.TextToSpeechClient() + + # Sets the text input to be synthesized + synthesis_input = texttospeech.types.SynthesisInput(ssml=ssml_text) + + # Builds the voice request, selects the language code ("en-US") and + # the SSML voice gender ("MALE") + voice = texttospeech.types.VoiceSelectionParams( + language_code='en-US', + ssml_gender=texttospeech.enums.SsmlVoiceGender.MALE) + + # Selects the type of audio file to return + audio_config = texttospeech.types.AudioConfig( + audio_encoding=texttospeech.enums.AudioEncoding.MP3) + + # Performs the text-to-speech request on the text input with the selected + # voice parameters and audio file type + response = client.synthesize_speech(synthesis_input, voice, audio_config) + + # Writes the synthetic audio to the output file. + with open(outfile, 'wb') as out: + out.write(response.audio_content) + print('Audio content written to file ' + outfile) + # [END tts_ssml_address_audio] + + +# [START tts_ssml_address_ssml] +def text_to_ssml(inputfile): + # Generates SSML text from plaintext. + # Given an input filename, this function converts the contents of the text + # file into a string of formatted SSML text. This function formats the SSML + # string so that, when synthesized, the synthetic audio will pause for two + # seconds between each line of the text file. This function also handles + # special text characters which might interfere with SSML commands. + # + # Args: + # inputfile: string name of plaintext file + # + # Returns: + # A string of SSML text based on plaintext input + + # Parses lines of input file + with open(inputfile, 'r') as f: + raw_lines = f.read() + + # Replace special characters with HTML Ampersand Character Codes + # These Codes prevent the API from confusing text with + # SSML commands + # For example, '<' --> '<' and '&' --> '&' + + escaped_lines = html.escape(raw_lines) + + # Convert plaintext to SSML + # Wait two seconds between each address + ssml = '{}'.format( + escaped_lines.replace('\n', '\n')) + + # Return the concatenated string of ssml script + return ssml +# [END tts_ssml_address_ssml] + + +# [START tts_ssml_address_test] +def main(): + # test example address file + plaintext = 'resources/example.txt' + ssml_text = text_to_ssml(plaintext) + ssml_to_audio(ssml_text, 'resources/example.mp3') + # [END tts_ssml_address_test] + + +if __name__ == '__main__': + main() diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py new file mode 100644 index 000000000000..0c4e810e76a2 --- /dev/null +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ssml_addresses import text_to_ssml +from ssml_addresses import ssml_to_audio + +import filecmp +import os + + +def test_text_to_ssml(capsys): + + # Read expected SSML output from resources + with open('resources/example.ssml', 'r') as f: + expected_ssml = f.read() + + # Assert plaintext converted to SSML + input_text = 'resources/example.txt' + tested_ssml = text_to_ssml(input_text) + assert expected_ssml == tested_ssml + + +def test_ssml_to_audio(capsys): + + # Read SSML input from resources + with open('resources/example.ssml', 'r') as f: + input_ssml = f.read() + + # Assert audio file generated + ssml_to_audio(input_ssml, 'test_example.mp3') + out, err = capsys.readouterr() + + # 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") From e332e7697fa3f28060065d129fecd79bb755984a Mon Sep 17 00:00:00 2001 From: Gus Class Date: Mon, 7 Oct 2019 15:45:22 -0700 Subject: [PATCH 14/65] Adds updates for samples profiler ... vision [(#2439)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2439) --- texttospeech/snippets/requirements.txt | 2 +- texttospeech/snippets/ssml_addresses_test.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 0db01b710b9b..0cd0886a3751 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.4.0 +google-cloud-texttospeech==0.5.0 diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py index 0c4e810e76a2..fe4da2867597 100644 --- a/texttospeech/snippets/ssml_addresses_test.py +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -15,7 +15,6 @@ from ssml_addresses import text_to_ssml from ssml_addresses import ssml_to_audio -import filecmp import os From 4a642ee290b25cdbe57855016eeb2a72cf70e3c0 Mon Sep 17 00:00:00 2001 From: Michelle Casbon Date: Fri, 10 Jan 2020 16:49:10 -0800 Subject: [PATCH 15/65] Add voice selection by name [(#2687)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2687) * Add voice selection by name * Add future to requirements.txt Fixes python2 test failures referencing html. Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> --- texttospeech/snippets/requirements.txt | 1 + texttospeech/snippets/synthesize_text.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 0cd0886a3751..ccf0a4d5e1b1 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1 +1,2 @@ +future==0.18.2 google-cloud-texttospeech==0.5.0 diff --git a/texttospeech/snippets/synthesize_text.py b/texttospeech/snippets/synthesize_text.py index d5886bd16f15..768c0da03178 100644 --- a/texttospeech/snippets/synthesize_text.py +++ b/texttospeech/snippets/synthesize_text.py @@ -36,6 +36,7 @@ def synthesize_text(text): # Names of voices can be retrieved with client.list_voices(). voice = texttospeech.types.VoiceSelectionParams( language_code='en-US', + name='en-US-Standard-C', ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) audio_config = texttospeech.types.AudioConfig( @@ -68,6 +69,7 @@ def synthesize_ssml(ssml): # Names of voices can be retrieved with client.list_voices(). voice = texttospeech.types.VoiceSelectionParams( language_code='en-US', + name='en-US-Standard-C', ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) audio_config = texttospeech.types.AudioConfig( From 3ef8ad4518396304e5d9cdb218334484cc839a50 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 29 Mar 2020 07:03:27 +0200 Subject: [PATCH 16/65] chore(deps): update dependency google-cloud-texttospeech to v1 [(#3210)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/3210) Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index ccf0a4d5e1b1..3d00a8bd1f4d 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==0.5.0 +google-cloud-texttospeech==1.0.1 From a7956f6db1b4e83284d2508a76bcae65b38eac2e Mon Sep 17 00:00:00 2001 From: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com> Date: Wed, 1 Apr 2020 19:11:50 -0700 Subject: [PATCH 17/65] Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2806) * chore(deps): update dependency requests to v2.23.0 * Simplify noxfile and add version control. * Configure appengine/standard to only test Python 2.7. * Update Kokokro configs to match noxfile. * Add requirements-test to each folder. * Remove Py2 versions from everything execept appengine/standard. * Remove conftest.py. * Remove appengine/standard/conftest.py * Remove 'no-sucess-flaky-report' from pytest.ini. * Add GAE SDK back to appengine/standard tests. * Fix typo. * Roll pytest to python 2 version. * Add a bunch of testing requirements. * Remove typo. * Add appengine lib directory back in. * Add some additional requirements. * Fix issue with flake8 args. * Even more requirements. * Readd appengine conftest.py. * Add a few more requirements. * Even more Appengine requirements. * Add webtest for appengine/standard/mailgun. * Add some additional requirements. * Add workaround for issue with mailjet-rest. * Add responses for appengine/standard/mailjet. Co-authored-by: Renovate Bot --- texttospeech/snippets/requirements-test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 texttospeech/snippets/requirements-test.txt diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt new file mode 100644 index 000000000000..781d4326c947 --- /dev/null +++ b/texttospeech/snippets/requirements-test.txt @@ -0,0 +1 @@ +pytest==5.3.2 From fb03368c8092c4e063ffbbbe30ac40aae6f5121a Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Tue, 12 May 2020 18:22:36 -0700 Subject: [PATCH 18/65] chore: some lint fixes [(#3750)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/3750) --- texttospeech/snippets/ssml_addresses.py | 3 ++- texttospeech/snippets/ssml_addresses_test.py | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/texttospeech/snippets/ssml_addresses.py b/texttospeech/snippets/ssml_addresses.py index b30cfce004f6..dd9276058a44 100644 --- a/texttospeech/snippets/ssml_addresses.py +++ b/texttospeech/snippets/ssml_addresses.py @@ -14,9 +14,10 @@ # [START tts_ssml_address_imports] +import html + from google.cloud import texttospeech -import html # [END tts_ssml_address_imports] diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py index fe4da2867597..5f0016085b15 100644 --- a/texttospeech/snippets/ssml_addresses_test.py +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -11,11 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import os -from ssml_addresses import text_to_ssml from ssml_addresses import ssml_to_audio - -import os +from ssml_addresses import text_to_ssml def test_text_to_ssml(capsys): From 1d31a0b04924794d921d351b09f8c99d4938ed3a Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 13 May 2020 04:21:19 +0000 Subject: [PATCH 19/65] fix: move samples into samples/snippets --- texttospeech/snippets/README.rst | 34 +++++++++++++++++++++-- texttospeech/snippets/noxfile_config.py | 37 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 texttospeech/snippets/noxfile_config.py diff --git a/texttospeech/snippets/README.rst b/texttospeech/snippets/README.rst index 7b877be1328b..ff08a7591d19 100644 --- a/texttospeech/snippets/README.rst +++ b/texttospeech/snippets/README.rst @@ -1,3 +1,4 @@ + .. This file is automatically generated. Do not edit this file directly. Google Cloud Text-to-Speech API Python Samples @@ -14,10 +15,12 @@ This directory contains samples for Google Cloud Text-to-Speech API. The `Google .. _Google Cloud Text-to-Speech API: https://cloud.google.com/text-to-speech/docs/ + Setup ------------------------------------------------------------------------------- + Authentication ++++++++++++++ @@ -28,6 +31,9 @@ credentials for applications. .. _Authentication Getting Started Guide: https://cloud.google.com/docs/authentication/getting-started + + + Install Dependencies ++++++++++++++++++++ @@ -42,7 +48,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash @@ -58,9 +64,15 @@ Install Dependencies .. _pip: https://pip.pypa.io/ .. _virtualenv: https://virtualenv.pypa.io/ + + + + + Samples ------------------------------------------------------------------------------- + Quickstart +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -77,6 +89,8 @@ To run this sample: $ python quickstart.py + + List voices +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -93,6 +107,8 @@ To run this sample: $ python list_voices.py + + Synthesize text +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -108,6 +124,7 @@ To run this sample: $ python synthesize_text.py + usage: synthesize_text.py [-h] (--text TEXT | --ssml SSML) Google Cloud Text-To-Speech API sample application . @@ -123,6 +140,8 @@ To run this sample: + + Synthesize file +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -138,6 +157,7 @@ To run this sample: $ python synthesize_file.py + usage: synthesize_file.py [-h] (--text TEXT | --ssml SSML) Google Cloud Text-To-Speech API sample application . @@ -153,6 +173,8 @@ To run this sample: + + Audio profile +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -168,6 +190,7 @@ To run this sample: $ python audio_profile.py + usage: audio_profile.py [-h] [--output OUTPUT] [--text TEXT] [--effects_profile_id EFFECTS_PROFILE_ID] @@ -175,7 +198,7 @@ To run this sample: Example usage: python audio_profile.py --text "hello" --effects_profile_id - "telephony-class-application" + "telephony-class-application" --output "output.mp3" optional arguments: -h, --help show this help message and exit @@ -188,6 +211,10 @@ To run this sample: + + + + The client library ------------------------------------------------------------------------------- @@ -203,4 +230,5 @@ to `browse the source`_ and `report issues`_. https://github.com/GoogleCloudPlatform/google-cloud-python/issues -.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ diff --git a/texttospeech/snippets/noxfile_config.py b/texttospeech/snippets/noxfile_config.py new file mode 100644 index 000000000000..6f358b8db3af --- /dev/null +++ b/texttospeech/snippets/noxfile_config.py @@ -0,0 +1,37 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Default TEST_CONFIG_OVERRIDE for python repos. + +# You can copy this file into your directory, then it will be inported from +# the noxfile.py. + +# The source of truth: +# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py + +TEST_CONFIG_OVERRIDE = { + # You can opt out from the test for specific Python versions. + 'ignored_versions': ["2.7"], + + # An envvar key for determining the project id to use. Change it + # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a + # build specific Cloud project. You can also use your own string + # to use your own Cloud project. + 'gcloud_project_env': 'GCLOUD_PROJECT', + # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', + + # A dictionary you want to inject into your test. Don't put any + # secrets here. These values will override predefined values. + 'envs': {}, +} From d3f5a118dd5e5066141feea3a1e34d40e3a536bb Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 19 May 2020 22:10:12 +0000 Subject: [PATCH 20/65] chore: remove noxfile config --- texttospeech/snippets/noxfile_config.py | 37 ------------------------- 1 file changed, 37 deletions(-) delete mode 100644 texttospeech/snippets/noxfile_config.py diff --git a/texttospeech/snippets/noxfile_config.py b/texttospeech/snippets/noxfile_config.py deleted file mode 100644 index 6f358b8db3af..000000000000 --- a/texttospeech/snippets/noxfile_config.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Default TEST_CONFIG_OVERRIDE for python repos. - -# You can copy this file into your directory, then it will be inported from -# the noxfile.py. - -# The source of truth: -# https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile_config.py - -TEST_CONFIG_OVERRIDE = { - # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], - - # An envvar key for determining the project id to use. Change it - # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a - # build specific Cloud project. You can also use your own string - # to use your own Cloud project. - 'gcloud_project_env': 'GCLOUD_PROJECT', - # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT', - - # A dictionary you want to inject into your test. Don't put any - # secrets here. These values will override predefined values. - 'envs': {}, -} From f0acca6dea791a4eaf9a809305047c754cf44a0f Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Mon, 1 Jun 2020 16:23:26 -0700 Subject: [PATCH 21/65] feat!: regenerate with microgenerator (#30) BREAKING CHANGE: This commit has breaking changes. For help migrating your code, see UPGRADING.md. --- texttospeech/snippets/audio_profile.py | 38 +++++------ texttospeech/snippets/audio_profile_test.py | 9 ++- texttospeech/snippets/list_voices.py | 17 ++--- texttospeech/snippets/list_voices_test.py | 6 +- texttospeech/snippets/quickstart.py | 21 +++--- texttospeech/snippets/ssml_addresses.py | 36 ++++++----- texttospeech/snippets/ssml_addresses_test.py | 10 +-- texttospeech/snippets/synthesize_file.py | 60 +++++++++-------- texttospeech/snippets/synthesize_file_test.py | 12 ++-- texttospeech/snippets/synthesize_text.py | 64 +++++++++++-------- texttospeech/snippets/synthesize_text_test.py | 12 ++-- 11 files changed, 160 insertions(+), 125 deletions(-) diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py index 01f2ba884ba3..cfecdb98cdd7 100644 --- a/texttospeech/snippets/audio_profile.py +++ b/texttospeech/snippets/audio_profile.py @@ -32,41 +32,43 @@ def synthesize_text_with_audio_profile(text, output, effects_profile_id): client = texttospeech.TextToSpeechClient() - input_text = texttospeech.types.SynthesisInput(text=text) + input_text = texttospeech.SynthesisInput(text=text) # Note: the voice can also be specified by name. # Names of voices can be retrieved with client.list_voices(). - voice = texttospeech.types.VoiceSelectionParams(language_code='en-US') + voice = texttospeech.VoiceSelectionParams(language_code="en-US") # Note: you can pass in multiple effects_profile_id. They will be applied # in the same order they are provided. - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3, - effects_profile_id=[effects_profile_id]) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3, + effects_profile_id=[effects_profile_id], + ) - response = client.synthesize_speech(input_text, voice, audio_config) + response = client.synthesize_speech( + input=input_text, voice=voice, audio_config=audio_config + ) # The response's audio_content is binary. - with open(output, 'wb') as out: + with open(output, "wb") as out: out.write(response.audio_content) print('Audio content written to file "%s"' % output) + # [END tts_synthesize_text_audio_profile_beta] # [END tts_synthesize_text_audio_profile] -if __name__ == '__main__': +if __name__ == "__main__": parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--output', - help='The output mp3 file.') - parser.add_argument('--text', - help='The text from which to synthesize speech.') - parser.add_argument('--effects_profile_id', - help='The audio effects profile id to be applied.') + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter + ) + parser.add_argument("--output", help="The output mp3 file.") + parser.add_argument("--text", help="The text from which to synthesize speech.") + parser.add_argument( + "--effects_profile_id", help="The audio effects profile id to be applied." + ) args = parser.parse_args() - synthesize_text_with_audio_profile(args.text, args.output, - args.effects_profile_id) + synthesize_text_with_audio_profile(args.text, args.output, args.effects_profile_id) diff --git a/texttospeech/snippets/audio_profile_test.py b/texttospeech/snippets/audio_profile_test.py index 43a30bf06d16..89616cf80a84 100644 --- a/texttospeech/snippets/audio_profile_test.py +++ b/texttospeech/snippets/audio_profile_test.py @@ -16,17 +16,16 @@ import audio_profile -TEXT = 'hello' -OUTPUT = 'output.mp3' -EFFECTS_PROFILE_ID = 'telephony-class-application' +TEXT = "hello" +OUTPUT = "output.mp3" +EFFECTS_PROFILE_ID = "telephony-class-application" def test_audio_profile(capsys): if os.path.exists(OUTPUT): os.remove(OUTPUT) assert not os.path.exists(OUTPUT) - audio_profile.synthesize_text_with_audio_profile(TEXT, OUTPUT, - EFFECTS_PROFILE_ID) + audio_profile.synthesize_text_with_audio_profile(TEXT, OUTPUT, EFFECTS_PROFILE_ID) out, err = capsys.readouterr() assert ('Audio content written to file "%s"' % OUTPUT) in out diff --git a/texttospeech/snippets/list_voices.py b/texttospeech/snippets/list_voices.py index a2da5a178528..4d991a952394 100644 --- a/texttospeech/snippets/list_voices.py +++ b/texttospeech/snippets/list_voices.py @@ -25,7 +25,7 @@ def list_voices(): """Lists the available voices.""" from google.cloud import texttospeech - from google.cloud.texttospeech import enums + client = texttospeech.TextToSpeechClient() # Performs the list voices request @@ -33,22 +33,23 @@ def list_voices(): for voice in voices.voices: # Display the voice's name. Example: tpc-vocoded - print('Name: {}'.format(voice.name)) + print(f"Name: {voice.name}") # Display the supported language codes for this voice. Example: "en-US" for language_code in voice.language_codes: - print('Supported language: {}'.format(language_code)) + print(f"Supported language: {language_code}") - ssml_gender = enums.SsmlVoiceGender(voice.ssml_gender) + ssml_gender = texttospeech.SsmlVoiceGender(voice.ssml_gender) # Display the SSML Voice Gender - print('SSML Voice Gender: {}'.format(ssml_gender.name)) + print(f"SSML Voice Gender: {ssml_gender.name}") # Display the natural sample rate hertz for this voice. Example: 24000 - print('Natural Sample Rate Hertz: {}\n'.format( - voice.natural_sample_rate_hertz)) + print(f"Natural Sample Rate Hertz: {voice.natural_sample_rate_hertz}\n") + + # [END tts_list_voices] -if __name__ == '__main__': +if __name__ == "__main__": list_voices() diff --git a/texttospeech/snippets/list_voices_test.py b/texttospeech/snippets/list_voices_test.py index fd3255694922..9260e86d5e13 100644 --- a/texttospeech/snippets/list_voices_test.py +++ b/texttospeech/snippets/list_voices_test.py @@ -18,6 +18,6 @@ def test_list_voices(capsys): list_voices.list_voices() out, err = capsys.readouterr() - assert 'en-US' in out - assert 'SSML Voice Gender: MALE' in out - assert 'SSML Voice Gender: FEMALE' in out + assert "en-US" in out + assert "SSML Voice Gender: MALE" in out + assert "SSML Voice Gender: FEMALE" in out diff --git a/texttospeech/snippets/quickstart.py b/texttospeech/snippets/quickstart.py index f462139d794b..f9e3da5ccee8 100644 --- a/texttospeech/snippets/quickstart.py +++ b/texttospeech/snippets/quickstart.py @@ -34,29 +34,32 @@ def run_quickstart(): client = texttospeech.TextToSpeechClient() # Set the text input to be synthesized - synthesis_input = texttospeech.types.SynthesisInput(text="Hello, World!") + synthesis_input = texttospeech.SynthesisInput(text="Hello, World!") # Build the voice request, select the language code ("en-US") and the ssml # voice gender ("neutral") - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - ssml_gender=texttospeech.enums.SsmlVoiceGender.NEUTRAL) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", ssml_gender=texttospeech.SsmlVoiceGender.NEUTRAL + ) # Select the type of audio file you want returned - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) # Perform the text-to-speech request on the text input with the selected # voice parameters and audio file type - response = client.synthesize_speech(synthesis_input, voice, audio_config) + response = client.synthesize_speech( + input=synthesis_input, voice=voice, audio_config=audio_config + ) # The response's audio_content is binary. - with open('output.mp3', 'wb') as out: + with open("output.mp3", "wb") as out: # Write the response to the output file. out.write(response.audio_content) print('Audio content written to file "output.mp3"') # [END tts_quickstart] -if __name__ == '__main__': +if __name__ == "__main__": run_quickstart() diff --git a/texttospeech/snippets/ssml_addresses.py b/texttospeech/snippets/ssml_addresses.py index dd9276058a44..512293576655 100644 --- a/texttospeech/snippets/ssml_addresses.py +++ b/texttospeech/snippets/ssml_addresses.py @@ -41,26 +41,29 @@ def ssml_to_audio(ssml_text, outfile): client = texttospeech.TextToSpeechClient() # Sets the text input to be synthesized - synthesis_input = texttospeech.types.SynthesisInput(ssml=ssml_text) + synthesis_input = texttospeech.SynthesisInput(ssml=ssml_text) # Builds the voice request, selects the language code ("en-US") and # the SSML voice gender ("MALE") - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - ssml_gender=texttospeech.enums.SsmlVoiceGender.MALE) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", ssml_gender=texttospeech.SsmlVoiceGender.MALE + ) # Selects the type of audio file to return - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) # Performs the text-to-speech request on the text input with the selected # voice parameters and audio file type - response = client.synthesize_speech(synthesis_input, voice, audio_config) + response = client.synthesize_speech( + input=synthesis_input, voice=voice, audio_config=audio_config + ) # Writes the synthetic audio to the output file. - with open(outfile, 'wb') as out: + with open(outfile, "wb") as out: out.write(response.audio_content) - print('Audio content written to file ' + outfile) + print("Audio content written to file " + outfile) # [END tts_ssml_address_audio] @@ -80,7 +83,7 @@ def text_to_ssml(inputfile): # A string of SSML text based on plaintext input # Parses lines of input file - with open(inputfile, 'r') as f: + with open(inputfile, "r") as f: raw_lines = f.read() # Replace special characters with HTML Ampersand Character Codes @@ -92,22 +95,25 @@ def text_to_ssml(inputfile): # Convert plaintext to SSML # Wait two seconds between each address - ssml = '{}'.format( - escaped_lines.replace('\n', '\n')) + ssml = "{}".format( + escaped_lines.replace("\n", '\n') + ) # Return the concatenated string of ssml script return ssml + + # [END tts_ssml_address_ssml] # [START tts_ssml_address_test] def main(): # test example address file - plaintext = 'resources/example.txt' + plaintext = "resources/example.txt" ssml_text = text_to_ssml(plaintext) - ssml_to_audio(ssml_text, 'resources/example.mp3') + ssml_to_audio(ssml_text, "resources/example.mp3") # [END tts_ssml_address_test] -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py index 5f0016085b15..caf25c0929bb 100644 --- a/texttospeech/snippets/ssml_addresses_test.py +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -20,11 +20,11 @@ def test_text_to_ssml(capsys): # Read expected SSML output from resources - with open('resources/example.ssml', 'r') as f: + with open("resources/example.ssml", "r") as f: expected_ssml = f.read() # Assert plaintext converted to SSML - input_text = 'resources/example.txt' + input_text = "resources/example.txt" tested_ssml = text_to_ssml(input_text) assert expected_ssml == tested_ssml @@ -32,15 +32,15 @@ def test_text_to_ssml(capsys): def test_ssml_to_audio(capsys): # Read SSML input from resources - with open('resources/example.ssml', 'r') as f: + with open("resources/example.ssml", "r") as f: input_ssml = f.read() # Assert audio file generated - ssml_to_audio(input_ssml, 'test_example.mp3') + ssml_to_audio(input_ssml, "test_example.mp3") out, err = capsys.readouterr() # Assert MP3 file created - assert os.path.isfile('test_example.mp3') + assert os.path.isfile("test_example.mp3") assert "Audio content written to file test_example.mp3" in out # Delete MP3 test file diff --git a/texttospeech/snippets/synthesize_file.py b/texttospeech/snippets/synthesize_file.py index f62d6330d7d5..977c049515b2 100644 --- a/texttospeech/snippets/synthesize_file.py +++ b/texttospeech/snippets/synthesize_file.py @@ -28,27 +28,33 @@ def synthesize_text_file(text_file): """Synthesizes speech from the input file of text.""" from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() - with open(text_file, 'r') as f: + with open(text_file, "r") as f: text = f.read() - input_text = texttospeech.types.SynthesisInput(text=text) + input_text = texttospeech.SynthesisInput(text=text) # Note: the voice can also be specified by name. # Names of voices can be retrieved with client.list_voices(). - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", ssml_gender=texttospeech.SsmlVoiceGender.FEMALE + ) - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) - response = client.synthesize_speech(input_text, voice, audio_config) + response = client.synthesize_speech( + request={"input": input_text, "voice": voice, "audio_config": audio_config} + ) # The response's audio_content is binary. - with open('output.mp3', 'wb') as out: + with open("output.mp3", "wb") as out: out.write(response.audio_content) print('Audio content written to file "output.mp3"') + + # [END tts_synthesize_text_file] @@ -60,39 +66,43 @@ def synthesize_ssml_file(ssml_file): https://www.w3.org/TR/speech-synthesis/ """ from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() - with open(ssml_file, 'r') as f: + with open(ssml_file, "r") as f: ssml = f.read() - input_text = texttospeech.types.SynthesisInput(ssml=ssml) + input_text = texttospeech.SynthesisInput(ssml=ssml) # Note: the voice can also be specified by name. # Names of voices can be retrieved with client.list_voices(). - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", ssml_gender=texttospeech.SsmlVoiceGender.FEMALE + ) - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) - response = client.synthesize_speech(input_text, voice, audio_config) + response = client.synthesize_speech( + input=input_text, voice=voice, audio_config=audio_config + ) # The response's audio_content is binary. - with open('output.mp3', 'wb') as out: + with open("output.mp3", "wb") as out: out.write(response.audio_content) print('Audio content written to file "output.mp3"') + + # [END tts_synthesize_ssml_file] -if __name__ == '__main__': +if __name__ == "__main__": parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter + ) group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('--text', - help='The text file from which to synthesize speech.') - group.add_argument('--ssml', - help='The ssml file from which to synthesize speech.') + group.add_argument("--text", help="The text file from which to synthesize speech.") + group.add_argument("--ssml", help="The ssml file from which to synthesize speech.") args = parser.parse_args() diff --git a/texttospeech/snippets/synthesize_file_test.py b/texttospeech/snippets/synthesize_file_test.py index 2652009f98b6..be6b6e052403 100644 --- a/texttospeech/snippets/synthesize_file_test.py +++ b/texttospeech/snippets/synthesize_file_test.py @@ -15,16 +15,16 @@ import synthesize_file -TEXT_FILE = 'resources/hello.txt' -SSML_FILE = 'resources/hello.ssml' +TEXT_FILE = "resources/hello.txt" +SSML_FILE = "resources/hello.ssml" def test_synthesize_text_file(capsys): synthesize_file.synthesize_text_file(text_file=TEXT_FILE) out, err = capsys.readouterr() - assert 'Audio content written to file' in out - statinfo = os.stat('output.mp3') + assert "Audio content written to file" in out + statinfo = os.stat("output.mp3") assert statinfo.st_size > 0 @@ -32,6 +32,6 @@ def test_synthesize_ssml_file(capsys): synthesize_file.synthesize_ssml_file(ssml_file=SSML_FILE) out, err = capsys.readouterr() - assert 'Audio content written to file' in out - statinfo = os.stat('output.mp3') + assert "Audio content written to file" in out + statinfo = os.stat("output.mp3") assert statinfo.st_size > 0 diff --git a/texttospeech/snippets/synthesize_text.py b/texttospeech/snippets/synthesize_text.py index 768c0da03178..c22bff40e2f4 100644 --- a/texttospeech/snippets/synthesize_text.py +++ b/texttospeech/snippets/synthesize_text.py @@ -28,26 +28,33 @@ def synthesize_text(text): """Synthesizes speech from the input string of text.""" from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() - input_text = texttospeech.types.SynthesisInput(text=text) + input_text = texttospeech.SynthesisInput(text=text) # Note: the voice can also be specified by name. # Names of voices can be retrieved with client.list_voices(). - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - name='en-US-Standard-C', - ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", + name="en-US-Standard-C", + ssml_gender=texttospeech.SsmlVoiceGender.FEMALE, + ) - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) - response = client.synthesize_speech(input_text, voice, audio_config) + response = client.synthesize_speech( + request={"input": input_text, "voice": voice, "audio_config": audio_config} + ) # The response's audio_content is binary. - with open('output.mp3', 'wb') as out: + with open("output.mp3", "wb") as out: out.write(response.audio_content) print('Audio content written to file "output.mp3"') + + # [END tts_synthesize_text] @@ -61,38 +68,45 @@ def synthesize_ssml(ssml): Example: Hello there. """ from google.cloud import texttospeech + client = texttospeech.TextToSpeechClient() - input_text = texttospeech.types.SynthesisInput(ssml=ssml) + input_text = texttospeech.SynthesisInput(ssml=ssml) # Note: the voice can also be specified by name. # Names of voices can be retrieved with client.list_voices(). - voice = texttospeech.types.VoiceSelectionParams( - language_code='en-US', - name='en-US-Standard-C', - ssml_gender=texttospeech.enums.SsmlVoiceGender.FEMALE) + voice = texttospeech.VoiceSelectionParams( + language_code="en-US", + name="en-US-Standard-C", + ssml_gender=texttospeech.SsmlVoiceGender.FEMALE, + ) - audio_config = texttospeech.types.AudioConfig( - audio_encoding=texttospeech.enums.AudioEncoding.MP3) + audio_config = texttospeech.AudioConfig( + audio_encoding=texttospeech.AudioEncoding.MP3 + ) - response = client.synthesize_speech(input_text, voice, audio_config) + response = client.synthesize_speech( + input=input_text, voice=voice, audio_config=audio_config + ) # The response's audio_content is binary. - with open('output.mp3', 'wb') as out: + with open("output.mp3", "wb") as out: out.write(response.audio_content) print('Audio content written to file "output.mp3"') + + # [END tts_synthesize_ssml] -if __name__ == '__main__': +if __name__ == "__main__": parser = argparse.ArgumentParser( - description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter + ) group = parser.add_mutually_exclusive_group(required=True) - group.add_argument('--text', - help='The text from which to synthesize speech.') - group.add_argument('--ssml', - help='The ssml string from which to synthesize speech.') + group.add_argument("--text", help="The text from which to synthesize speech.") + group.add_argument( + "--ssml", help="The ssml string from which to synthesize speech." + ) args = parser.parse_args() diff --git a/texttospeech/snippets/synthesize_text_test.py b/texttospeech/snippets/synthesize_text_test.py index 948d58da26df..68c52e38a648 100644 --- a/texttospeech/snippets/synthesize_text_test.py +++ b/texttospeech/snippets/synthesize_text_test.py @@ -15,16 +15,16 @@ import synthesize_text -TEXT = 'Hello there.' -SSML = 'Hello there.' +TEXT = "Hello there." +SSML = "Hello there." def test_synthesize_text(capsys): synthesize_text.synthesize_text(text=TEXT) out, err = capsys.readouterr() - assert 'Audio content written to file' in out - statinfo = os.stat('output.mp3') + assert "Audio content written to file" in out + statinfo = os.stat("output.mp3") assert statinfo.st_size > 0 @@ -32,6 +32,6 @@ def test_synthesize_ssml(capsys): synthesize_text.synthesize_ssml(ssml=SSML) out, err = capsys.readouterr() - assert 'Audio content written to file' in out - statinfo = os.stat('output.mp3') + assert "Audio content written to file" in out + statinfo = os.stat("output.mp3") assert statinfo.st_size > 0 From 55ce9c9546d8d0f4564ff297cba2d87ba9349f5c Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 2 Jun 2020 10:25:13 -0700 Subject: [PATCH 22/65] samples: update library dep to 2.0.0 (#36) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 3d00a8bd1f4d..bbf14c080968 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==1.0.1 +google-cloud-texttospeech==2.0.0 From 04a9a46757c2918528c60342c2b2ee84c3a09458 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 24 Jun 2020 19:50:29 +0200 Subject: [PATCH 23/65] chore(deps): update dependency google-cloud-texttospeech to v2.1.0 (#57) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index bbf14c080968..7c1cd48015ee 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.0.0 +google-cloud-texttospeech==2.1.0 From 0dde73a301cf15bf2b33bd36e82fd9dd1a7ee229 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Aug 2020 23:25:42 +0200 Subject: [PATCH 24/65] chore(deps): update dependency google-cloud-texttospeech to v2.2.0 (#78) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 7c1cd48015ee..a516da558962 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.1.0 +google-cloud-texttospeech==2.2.0 From 16d79c0b1c7ff30a0d95a067afb5199750ff731d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Apr 2021 19:26:14 +0200 Subject: [PATCH 25/65] chore(deps): update dependency google-cloud-texttospeech to v2.3.0 (#116) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index a516da558962..f32a07ff1da6 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.2.0 +google-cloud-texttospeech==2.3.0 From ef5d19c45a07b3fe203604f464daffc0cac1c6c5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 28 Apr 2021 19:55:29 +0200 Subject: [PATCH 26/65] chore(deps): update dependency pytest to v6 (#126) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 781d4326c947..f7e3ec09da60 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==5.3.2 +pytest==6.2.3 From 4106030056f3556c236a490c7bb4f44cd8b524dd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 14 May 2021 03:08:10 +0200 Subject: [PATCH 27/65] chore(deps): update dependency pytest to v6.2.4 (#135) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index f7e3ec09da60..95ea1e6a02b0 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.3 +pytest==6.2.4 From 434c952971d30522874da44d8f7ed6c75038d87b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Jun 2021 18:51:09 +0200 Subject: [PATCH 28/65] chore(deps): update dependency google-cloud-texttospeech to v2.4.0 (#148) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index f32a07ff1da6..485e9a4108e2 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.3.0 +google-cloud-texttospeech==2.4.0 From 249b361c9e71e706637b2d2113544158124e2872 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 1 Jul 2021 20:28:23 +0200 Subject: [PATCH 29/65] chore(deps): update dependency google-cloud-texttospeech to v2.5.0 (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-texttospeech](https://togithub.com/googleapis/python-texttospeech) | `==2.4.0` -> `==2.5.0` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.0/compatibility-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.0/confidence-slim/2.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/python-texttospeech ### [`v2.5.0`](https://togithub.com/googleapis/python-texttospeech/blob/master/CHANGELOG.md#​250-httpswwwgithubcomgoogleapispython-texttospeechcomparev240v250-2021-07-01) [Compare Source](https://togithub.com/googleapis/python-texttospeech/compare/v2.4.0...v2.5.0) ##### Features - add always_use_jwt_access ([#​155](https://www.github.com/googleapis/python-texttospeech/issues/155)) ([cd10c37](https://www.github.com/googleapis/python-texttospeech/commit/cd10c3704db610f2abf65c9142cfdaa867d8490a)) ##### Bug Fixes - disable always_use_jwt_access ([#​159](https://www.github.com/googleapis/python-texttospeech/issues/159)) ([d109303](https://www.github.com/googleapis/python-texttospeech/commit/d109303898facc663a6e7fe9212440831c1eeb75)) ##### Documentation - omit mention of Python 2.7 in 'CONTRIBUTING.rst' ([#​1127](https://www.github.com/googleapis/python-texttospeech/issues/1127)) ([#​150](https://www.github.com/googleapis/python-texttospeech/issues/150)) ([d2954ba](https://www.github.com/googleapis/python-texttospeech/commit/d2954ba91385db6d581f75154fb11c969f6ca0e2)), closes [#​1126](https://www.github.com/googleapis/python-texttospeech/issues/1126)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-texttospeech). --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 485e9a4108e2..4fef7dafb5af 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.4.0 +google-cloud-texttospeech==2.5.0 From f6b387de7f5467ed9bc127bbc3fe78d9267af100 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 22 Jul 2021 16:24:11 +0200 Subject: [PATCH 30/65] chore(deps): update dependency google-cloud-texttospeech to v2.5.1 (#168) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [google-cloud-texttospeech](https://togithub.com/googleapis/python-texttospeech) | `==2.5.0` -> `==2.5.1` | [![age](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.1/compatibility-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/google-cloud-texttospeech/2.5.1/confidence-slim/2.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/python-texttospeech ### [`v2.5.1`](https://togithub.com/googleapis/python-texttospeech/blob/master/CHANGELOG.md#​251-httpswwwgithubcomgoogleapispython-texttospeechcomparev250v251-2021-07-20) [Compare Source](https://togithub.com/googleapis/python-texttospeech/compare/v2.5.0...v2.5.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-texttospeech). --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 4fef7dafb5af..86eb8245c49c 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.5.0 +google-cloud-texttospeech==2.5.1 From af57a51e4bb0ae90f2ca4de818eff4d50306bc91 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 29 Jul 2021 13:08:19 +0200 Subject: [PATCH 31/65] chore(deps): update dependency google-cloud-texttospeech to v2.5.2 (#174) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 86eb8245c49c..e1cc5bbfe4f2 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.5.1 +google-cloud-texttospeech==2.5.2 From b61c0c955bf90a6a5c2c36d5022f6ab92d6e4fa7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 31 Aug 2021 16:44:26 +0200 Subject: [PATCH 32/65] chore(deps): update dependency pytest to v6.2.5 (#182) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 95ea1e6a02b0..927094516e65 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.4 +pytest==6.2.5 From 6f99b2b8639bb7ac1de7a55c0d09a088f1440ff4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Sep 2021 19:48:18 +0200 Subject: [PATCH 33/65] chore(deps): update dependency google-cloud-texttospeech to v2.5.3 (#193) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index e1cc5bbfe4f2..5972ce4dbd33 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.5.2 +google-cloud-texttospeech==2.5.3 From 95dd7252357b951d498fe692f2feb104eb9f5a5a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Oct 2021 15:58:15 +0200 Subject: [PATCH 34/65] chore(deps): update dependency google-cloud-texttospeech to v2.6.0 (#198) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 5972ce4dbd33..adb2c42a4570 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.5.3 +google-cloud-texttospeech==2.6.0 From 0a7feb071da9d00b113d555ae9f6df89da4c0880 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Oct 2021 15:56:07 +0200 Subject: [PATCH 35/65] chore(deps): update dependency google-cloud-texttospeech to v2.7.0 (#207) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index adb2c42a4570..a01177a8e733 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.6.0 +google-cloud-texttospeech==2.7.0 From e81d9860ff0b3346a7642ca6d50c0d9f110469a1 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Nov 2021 19:17:14 +0100 Subject: [PATCH 36/65] chore(deps): update dependency google-cloud-texttospeech to v2.7.1 (#211) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index a01177a8e733..940dbb9e0614 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.7.0 +google-cloud-texttospeech==2.7.1 From f378a315a1cf654c1f4310284a5c8a947cda1f3f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 17:46:16 +0100 Subject: [PATCH 37/65] chore(deps): update dependency google-cloud-texttospeech to v2.8.0 (#219) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 940dbb9e0614..18e57e1b5358 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.7.1 +google-cloud-texttospeech==2.8.0 From 065bc726b5d91281889721fed2e5acdaa179a20b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 20 Nov 2021 01:10:12 +0100 Subject: [PATCH 38/65] chore(deps): update dependency google-cloud-texttospeech to v2.9.0 (#223) Co-authored-by: Anthonios Partheniou --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 18e57e1b5358..2a08dce3a888 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.8.0 +google-cloud-texttospeech==2.9.0 From 5915180ac2ac7bdc26b275e62ccf8bf842d2f2ac Mon Sep 17 00:00:00 2001 From: nayaknishant Date: Mon, 6 Dec 2021 14:45:05 -0800 Subject: [PATCH 39/65] docs: Added virtualenv comment for clarity (#225) --- texttospeech/snippets/quickstart.py | 1 + 1 file changed, 1 insertion(+) diff --git a/texttospeech/snippets/quickstart.py b/texttospeech/snippets/quickstart.py index f9e3da5ccee8..2c2434df75ec 100644 --- a/texttospeech/snippets/quickstart.py +++ b/texttospeech/snippets/quickstart.py @@ -24,6 +24,7 @@ def run_quickstart(): # [START tts_quickstart] """Synthesizes speech from the input string of text or ssml. + Make sure to be working in a virtual environment. Note: ssml must be well-formed according to: https://www.w3.org/TR/speech-synthesis/ From f605faf3db133820f30468f3d7b047129f84e96a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 19 Jan 2022 10:40:43 +0100 Subject: [PATCH 40/65] chore(deps): update dependency google-cloud-texttospeech to v2.9.1 (#239) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 2a08dce3a888..273aeb1dfedd 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.9.0 +google-cloud-texttospeech==2.9.1 From 65eb3f0bd7a77e0a241ad5ab51b06c5f18e3df13 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 9 Feb 2022 13:03:12 +0100 Subject: [PATCH 41/65] chore(deps): update all dependencies (#247) --- texttospeech/snippets/requirements-test.txt | 2 +- texttospeech/snippets/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 927094516e65..4a46ff600804 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.5 +pytest==7.0.0 diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 273aeb1dfedd..a2f48d13d776 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.9.1 +google-cloud-texttospeech==2.10.0 From 3d9ec42891e571458e72c7c85983adc887272c81 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 26 Feb 2022 19:30:07 +0100 Subject: [PATCH 42/65] chore(deps): update dependency pytest to v7.0.1 (#251) Co-authored-by: Anthonios Partheniou --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 4a46ff600804..c2845bffbe89 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.0 +pytest==7.0.1 From 4b0f6ca0cf102de10683fe6dbed13e7892d6d83a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Mar 2022 12:14:53 +0100 Subject: [PATCH 43/65] chore(deps): update all dependencies (#255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index a2f48d13d776..391c64be50fc 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.10.0 +google-cloud-texttospeech==2.10.1 From aa4aa9cc15c7f83ea8f12d91511b2504c39cc559 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 02:43:02 +0100 Subject: [PATCH 44/65] chore(deps): update dependency google-cloud-texttospeech to v2.10.2 (#265) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 391c64be50fc..bb6f49a4b483 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.10.1 +google-cloud-texttospeech==2.10.2 From 92459ab3f3eadbcef6669ab4448e6bd7b9e8e6bf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 12 Mar 2022 18:48:36 +0100 Subject: [PATCH 45/65] chore(deps): update dependency google-cloud-texttospeech to v2.11.0 (#269) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index bb6f49a4b483..c6d36955f6fa 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.10.2 +google-cloud-texttospeech==2.11.0 From 37383a0168d0ae0e3904b64c69b6ed96dfb81c14 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 13 Mar 2022 21:03:42 +0100 Subject: [PATCH 46/65] chore(deps): update dependency pytest to v7.1.0 (#270) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index c2845bffbe89..824a8a7a0ce6 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 +pytest==7.1.0 From 3fce75ecf9b75811ffc1e99fdee3599c119f7067 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 19 Mar 2022 11:17:46 +0100 Subject: [PATCH 47/65] chore(deps): update dependency pytest to v7.1.1 (#271) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 824a8a7a0ce6..4f6bf643fc5e 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 +pytest==7.1.1 From ee2d6c806bf48f2ea33affc8ba0e72f03f0e95ab Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 21:26:04 -0400 Subject: [PATCH 48/65] chore(python): add nox session to sort python imports (#285) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- texttospeech/snippets/ssml_addresses_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py index caf25c0929bb..cea46da40f29 100644 --- a/texttospeech/snippets/ssml_addresses_test.py +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -13,8 +13,7 @@ # limitations under the License. import os -from ssml_addresses import ssml_to_audio -from ssml_addresses import text_to_ssml +from ssml_addresses import ssml_to_audio, text_to_ssml def test_text_to_ssml(capsys): From 8c6fd4d35d9c5da2b40f78086aa7630839914ca3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Apr 2022 16:56:51 +0200 Subject: [PATCH 49/65] chore(deps): update dependency pytest to v7.1.2 (#288) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index 4f6bf643fc5e..d00689e0623a 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 +pytest==7.1.2 From 79603705e82edf270626d58f934140ddbe83c764 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 16 Jul 2022 17:20:19 +0200 Subject: [PATCH 50/65] chore(deps): update all dependencies (#298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index c6d36955f6fa..550b89905326 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.11.0 +google-cloud-texttospeech==2.11.1 From e16d3ded5f54e5c2da92754a3a6fe65952ddcdee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 14:56:46 +0200 Subject: [PATCH 51/65] chore(deps): update all dependencies (#312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update all dependencies * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 550b89905326..001b2d6e465e 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.11.1 +google-cloud-texttospeech==2.12.0 From 77d95e3338dbf32dc8e8b72559c6f0b7426929b5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 16:59:12 +0200 Subject: [PATCH 52/65] chore(deps): update dependency google-cloud-texttospeech to v2.12.1 (#319) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 001b2d6e465e..b654c18c149b 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.12.0 +google-cloud-texttospeech==2.12.1 From 49ab3095bf211f8b0b759af62184d5eacfd14a29 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Sep 2022 17:39:36 +0200 Subject: [PATCH 53/65] chore(deps): update dependency pytest to v7.1.3 (#328) * chore(deps): update all dependencies * revert Co-authored-by: Anthonios Partheniou --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index d00689e0623a..e07168502ea9 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.2 +pytest==7.1.3 From 13348919ff622717b4059614910326254e066e95 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 4 Oct 2022 15:43:25 +0200 Subject: [PATCH 54/65] chore(deps): update dependency google-cloud-texttospeech to v2.12.2 (#337) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index b654c18c149b..953235c8956d 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.12.1 +google-cloud-texttospeech==2.12.2 From 9ba072fa80e416445bf6d67010f957fda3fbe281 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 18 Oct 2022 15:20:17 +0200 Subject: [PATCH 55/65] chore(deps): update dependency google-cloud-texttospeech to v2.12.3 (#340) --- texttospeech/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements.txt b/texttospeech/snippets/requirements.txt index 953235c8956d..b427a1ce2bd7 100644 --- a/texttospeech/snippets/requirements.txt +++ b/texttospeech/snippets/requirements.txt @@ -1,2 +1,2 @@ future==0.18.2 -google-cloud-texttospeech==2.12.2 +google-cloud-texttospeech==2.12.3 From 97a1bf958b190616aad08ca1ee4984e51f63010a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Oct 2022 12:55:16 +0200 Subject: [PATCH 56/65] chore(deps): update dependency pytest to v7.2.0 (#341) --- texttospeech/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/snippets/requirements-test.txt b/texttospeech/snippets/requirements-test.txt index e07168502ea9..49780e035690 100644 --- a/texttospeech/snippets/requirements-test.txt +++ b/texttospeech/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.3 +pytest==7.2.0 From 449e5a9673d2e5eb1298a4ac50f86391bbea6553 Mon Sep 17 00:00:00 2001 From: Sampath M Date: Thu, 10 Nov 2022 14:26:34 +0100 Subject: [PATCH 57/65] Update CODEOWNERS file and update Copyright for audio_profile.py and audio_profile_test.py --- .github/CODEOWNERS | 3 ++- texttospeech/snippets/audio_profile.py | 5 +++-- texttospeech/snippets/audio_profile_test.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6fcc03d77f88..48ae8479d3eb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -65,6 +65,7 @@ /run/django/**/* @glasnt @GoogleCloudPlatform/aap-dpes @GoogleCloudPlatform/python-samples-reviewers /storage/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers /storagetransfer/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers +/texttospeech/snippets @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/python-samples-reviewers /trace/**/* @ymotongpoo @GoogleCloudPlatform/python-samples-reviewers /translate/**/* @nicain @GoogleCloudPlatform/python-samples-reviewers -/workflows/**/* @GoogleCloudPlatform/python-samples-reviewers +/workflows/**/* @GoogleCloudPlatform/python-samples-reviewers \ No newline at end of file diff --git a/texttospeech/snippets/audio_profile.py b/texttospeech/snippets/audio_profile.py index cfecdb98cdd7..70921cf775f2 100644 --- a/texttospeech/snippets/audio_profile.py +++ b/texttospeech/snippets/audio_profile.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - -# Copyright 2018 Google LLC. All Rights Reserved. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. """Google Cloud Text-To-Speech API sample application for audio profile. diff --git a/texttospeech/snippets/audio_profile_test.py b/texttospeech/snippets/audio_profile_test.py index 89616cf80a84..74a2255e95ad 100644 --- a/texttospeech/snippets/audio_profile_test.py +++ b/texttospeech/snippets/audio_profile_test.py @@ -1,9 +1,11 @@ -# Copyright 2018, Google, LLC. +#!/usr/bin/env python +# Copyright 2018 Google LLC +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, From 31ff224d5c08990757c69c589891f04e635412fe Mon Sep 17 00:00:00 2001 From: Sampath M Date: Thu, 10 Nov 2022 14:30:37 +0100 Subject: [PATCH 58/65] Update copyright for all .py files in texttospeecch/snippets/ --- texttospeech/snippets/list_voices.py | 5 +++-- texttospeech/snippets/list_voices_test.py | 8 ++++++-- texttospeech/snippets/ssml_addresses.py | 5 ++++- texttospeech/snippets/ssml_addresses_test.py | 6 +++++- texttospeech/snippets/synthesize_file.py | 5 +++-- texttospeech/snippets/synthesize_file_test.py | 8 ++++++-- texttospeech/snippets/synthesize_text.py | 5 +++-- texttospeech/snippets/synthesize_text_test.py | 8 ++++++-- 8 files changed, 36 insertions(+), 14 deletions(-) diff --git a/texttospeech/snippets/list_voices.py b/texttospeech/snippets/list_voices.py index 4d991a952394..ddfe099d4c1f 100644 --- a/texttospeech/snippets/list_voices.py +++ b/texttospeech/snippets/list_voices.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - -# Copyright 2018 Google Inc. All Rights Reserved. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. """Google Cloud Text-To-Speech API sample application. diff --git a/texttospeech/snippets/list_voices_test.py b/texttospeech/snippets/list_voices_test.py index 9260e86d5e13..889df226b452 100644 --- a/texttospeech/snippets/list_voices_test.py +++ b/texttospeech/snippets/list_voices_test.py @@ -1,15 +1,19 @@ -# Copyright 2018, Google, Inc. +#!/usr/bin/env python +# Copyright 2018 Google LLC +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. import list_voices diff --git a/texttospeech/snippets/ssml_addresses.py b/texttospeech/snippets/ssml_addresses.py index 512293576655..817929f435f7 100644 --- a/texttospeech/snippets/ssml_addresses.py +++ b/texttospeech/snippets/ssml_addresses.py @@ -1,4 +1,5 @@ -# Copyright 2019 Google LLC +#!/usr/bin/env python +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. # [START tts_ssml_address_imports] diff --git a/texttospeech/snippets/ssml_addresses_test.py b/texttospeech/snippets/ssml_addresses_test.py index cea46da40f29..54b984b51e0f 100644 --- a/texttospeech/snippets/ssml_addresses_test.py +++ b/texttospeech/snippets/ssml_addresses_test.py @@ -1,4 +1,5 @@ -# Copyright 2019 Google LLC +#!/usr/bin/env python +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,6 +12,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. + import os from ssml_addresses import ssml_to_audio, text_to_ssml diff --git a/texttospeech/snippets/synthesize_file.py b/texttospeech/snippets/synthesize_file.py index 977c049515b2..d9bdcd40a7f8 100644 --- a/texttospeech/snippets/synthesize_file.py +++ b/texttospeech/snippets/synthesize_file.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - -# Copyright 2018 Google Inc. All Rights Reserved. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. """Google Cloud Text-To-Speech API sample application . diff --git a/texttospeech/snippets/synthesize_file_test.py b/texttospeech/snippets/synthesize_file_test.py index be6b6e052403..d28479571c93 100644 --- a/texttospeech/snippets/synthesize_file_test.py +++ b/texttospeech/snippets/synthesize_file_test.py @@ -1,15 +1,19 @@ -# Copyright 2018, Google, Inc. +#!/usr/bin/env python +# Copyright 2018 Google LLC +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. import os diff --git a/texttospeech/snippets/synthesize_text.py b/texttospeech/snippets/synthesize_text.py index c22bff40e2f4..331106656d34 100644 --- a/texttospeech/snippets/synthesize_text.py +++ b/texttospeech/snippets/synthesize_text.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - -# Copyright 2018 Google Inc. All Rights Reserved. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. """Google Cloud Text-To-Speech API sample application . diff --git a/texttospeech/snippets/synthesize_text_test.py b/texttospeech/snippets/synthesize_text_test.py index 68c52e38a648..4af85f031146 100644 --- a/texttospeech/snippets/synthesize_text_test.py +++ b/texttospeech/snippets/synthesize_text_test.py @@ -1,15 +1,19 @@ -# Copyright 2018, Google, Inc. +#!/usr/bin/env python +# Copyright 2018 Google LLC +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. import os From 9c7e7fc666e6c09f1f0494a178fc68072b1839c5 Mon Sep 17 00:00:00 2001 From: Sampath Kumar Date: Mon, 14 Nov 2022 15:56:30 +0100 Subject: [PATCH 59/65] Update .github/CODEOWNERS Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index eb391c082d4c..ebb1d5ffd21c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -66,7 +66,7 @@ /secretmanager/**/* @GoogleCloudPlatform/aap-dpes @GoogleCloudPlatform/python-samples-reviewers /storage/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers /storagetransfer/**/* @GoogleCloudPlatform/cloud-storage-dpes @GoogleCloudPlatform/python-samples-reviewers -/texttospeech/snippets @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/python-samples-reviewers +/texttospeech/**/* @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/python-samples-reviewers /trace/**/* @ymotongpoo @GoogleCloudPlatform/python-samples-reviewers /translate/**/* @nicain @GoogleCloudPlatform/python-samples-reviewers /workflows/**/* @GoogleCloudPlatform/python-samples-reviewers \ No newline at end of file From a4d14bd12278cfc75c9ec8212ed6b53d46f52ada Mon Sep 17 00:00:00 2001 From: Sampath Kumar Date: Mon, 14 Nov 2022 15:56:43 +0100 Subject: [PATCH 60/65] Update .github/CODEOWNERS Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ebb1d5ffd21c..d687be269ac9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -69,4 +69,4 @@ /texttospeech/**/* @GoogleCloudPlatform/dee-platform-ops @GoogleCloudPlatform/python-samples-reviewers /trace/**/* @ymotongpoo @GoogleCloudPlatform/python-samples-reviewers /translate/**/* @nicain @GoogleCloudPlatform/python-samples-reviewers -/workflows/**/* @GoogleCloudPlatform/python-samples-reviewers \ No newline at end of file +/workflows/**/* @GoogleCloudPlatform/python-samples-reviewers From 16a850193c986d155c638e249e509413c1edac71 Mon Sep 17 00:00:00 2001 From: Sampath M Date: Mon, 14 Nov 2022 15:58:55 +0100 Subject: [PATCH 61/65] Update blunderbuss.yml --- .github/blunderbuss.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 97e0b4b04893..d4608acf27fe 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -121,11 +121,15 @@ assign_issues_by: - 'api: datalabeling' to: - GoogleCloudPlatform/python-samples-reviewers - - ivanmkc + - ivanmkc - labels: - 'api: monitoring' - to: + to: - GoogleCloudPlatform/dee-observability +- labels: + - 'api: texttospeech' + to: + - GoogleCloudPlatform/dee-platform-ops assign_prs_by: - labels: From 6769eda642f0bb2657b4071e263bb501a9bdb191 Mon Sep 17 00:00:00 2001 From: Sampath M Date: Mon, 14 Nov 2022 16:01:01 +0100 Subject: [PATCH 62/65] Update quickstart.py license header --- texttospeech/snippets/quickstart.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/texttospeech/snippets/quickstart.py b/texttospeech/snippets/quickstart.py index 2c2434df75ec..1e2f92ea0ca3 100644 --- a/texttospeech/snippets/quickstart.py +++ b/texttospeech/snippets/quickstart.py @@ -1,6 +1,5 @@ #!/usr/bin/env python - -# Copyright 2018 Google Inc. All Rights Reserved. +# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# +# All Rights Reserved. """Google Cloud Text-To-Speech API sample application . From 715f176b033aed82f086e3ef095975586303317c Mon Sep 17 00:00:00 2001 From: Sampath M Date: Tue, 15 Nov 2022 15:48:17 +0100 Subject: [PATCH 63/65] Add missing copyright headers to text files --- texttospeech/snippets/resources/example.txt | 13 +++++++++++++ texttospeech/snippets/resources/hello.txt | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/texttospeech/snippets/resources/example.txt b/texttospeech/snippets/resources/example.txt index 9cd7d74db361..543f3aa4e221 100644 --- a/texttospeech/snippets/resources/example.txt +++ b/texttospeech/snippets/resources/example.txt @@ -1,3 +1,16 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 123 Street Ln, Small Town, IL 12345 USA 1 Jenny St & Number St, Tutone City, CA 86753 1 Piazza del Fibonacci, 12358 Pisa, Italy diff --git a/texttospeech/snippets/resources/hello.txt b/texttospeech/snippets/resources/hello.txt index cd773cd131fc..dffafe75fdf4 100644 --- a/texttospeech/snippets/resources/hello.txt +++ b/texttospeech/snippets/resources/hello.txt @@ -1 +1,14 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. Hello there! \ No newline at end of file From 6f631902fb8b1124e6e0e8b9d322a59036bf821c Mon Sep 17 00:00:00 2001 From: Sampath M Date: Tue, 15 Nov 2022 22:38:19 +0100 Subject: [PATCH 64/65] Update header-checker-lint.yml to exclude hello.txt and example.txt --- .github/header-checker-lint.yml | 3 +++ texttospeech/snippets/resources/example.txt | 13 ------------- texttospeech/snippets/resources/hello.txt | 13 ------------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml index d71c5bc28383..5e8ea1c0b09c 100644 --- a/.github/header-checker-lint.yml +++ b/.github/header-checker-lint.yml @@ -16,6 +16,9 @@ ignoreFiles: - "**/constraints-test.txt" - "**/apt.txt" - "**/ghcnd-stations.txt" + - "**/example.txt" + - "**/hello.txt" + ignoreLicenseYear: true diff --git a/texttospeech/snippets/resources/example.txt b/texttospeech/snippets/resources/example.txt index 543f3aa4e221..9cd7d74db361 100644 --- a/texttospeech/snippets/resources/example.txt +++ b/texttospeech/snippets/resources/example.txt @@ -1,16 +1,3 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. 123 Street Ln, Small Town, IL 12345 USA 1 Jenny St & Number St, Tutone City, CA 86753 1 Piazza del Fibonacci, 12358 Pisa, Italy diff --git a/texttospeech/snippets/resources/hello.txt b/texttospeech/snippets/resources/hello.txt index dffafe75fdf4..cd773cd131fc 100644 --- a/texttospeech/snippets/resources/hello.txt +++ b/texttospeech/snippets/resources/hello.txt @@ -1,14 +1 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. Hello there! \ No newline at end of file From f831b88593748ac77bb8ca9e55859eb8dabfc234 Mon Sep 17 00:00:00 2001 From: Dan Lee <71398022+dandhlee@users.noreply.github.com> Date: Tue, 15 Nov 2022 19:52:51 -0600 Subject: [PATCH 65/65] chore(header): update to reference specific files --- .github/header-checker-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml index 5e8ea1c0b09c..30c6c690f9de 100644 --- a/.github/header-checker-lint.yml +++ b/.github/header-checker-lint.yml @@ -16,8 +16,8 @@ ignoreFiles: - "**/constraints-test.txt" - "**/apt.txt" - "**/ghcnd-stations.txt" - - "**/example.txt" - - "**/hello.txt" + - "texttospeech/snippets/resources/example.txt" + - "texttospeech/snippets/resources/hello.txt" ignoreLicenseYear: true