From 46d08a74c962f0e78b4dc6975fd5e6283ed77f0e Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 15:38:18 -0700 Subject: [PATCH 01/16] Added Audio Profile sample --- texttospeech/cloud-client/README.rst.in | 3 + texttospeech/cloud-client/audio_profile.py | 62 +++++++++++++++++++ .../cloud-client/audio_profile_test.py | 31 ++++++++++ 3 files changed, 96 insertions(+) create mode 100644 texttospeech/cloud-client/audio_profile.py create mode 100644 texttospeech/cloud-client/audio_profile_test.py diff --git a/texttospeech/cloud-client/README.rst.in b/texttospeech/cloud-client/README.rst.in index e0cee295759..8be6ab46774 100644 --- a/texttospeech/cloud-client/README.rst.in +++ b/texttospeech/cloud-client/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/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py new file mode 100644 index 00000000000..5b68a3efcec --- /dev/null +++ b/texttospeech/cloud-client/audio_profile.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 for audio profile feature. + +Example usage: + python audio_profile.py --text "hello" --effects_profile_id "telephony-class-application" +""" + +import argparse +from google.cloud import texttospeech_v1beta1 as texttospeech + + +# [START tts_synthesize_text] +def synthesize_text(text, output, effects_profile_id): + """Synthesizes speech from the input string of text.""" + 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] + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--text', help='The text from which to synthesize speech.') + parser.add_argument('--output', help='The output mp3 file.') + parser.add_argument('--effects_profile_id', help='The audio effects profile id to be applied.') + + args = parser.parse_args() + + synthesize_text(args.text, args.output, args.effects_profile_id) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py new file mode 100644 index 00000000000..b796e6e28bc --- /dev/null +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -0,0 +1,31 @@ +# 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 audio_profile +import os +import os.path + +TEXT = 'hello' +OUTOUT = 'output.mp3' +EFFECTS_PROFILE_ID = 'telephony-class-application' + + +def test_audio_profile(capsys): + if os.path.exists(OUTOUT): + os.remove(OUTOUT) + assert not os.path.exists(OUTOUT) + audio_profile.synthesize_text(TEXT, OUTOUT, EFFECTS_PROFILE_ID) + out, err = capsys.readouterr() + + assert ('Audio content written to "%s"' % OUTOUT) in out + assert os.path.exists(OUTOUT) From 0b5d99e3a6fd77765361ed046f01ff7ccd315236 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 15:48:57 -0700 Subject: [PATCH 02/16] Adjusted the row lengths --- texttospeech/cloud-client/audio_profile.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 5b68a3efcec..cf15c1735fb 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -17,7 +17,8 @@ """Google Cloud Text-To-Speech API sample application for audio profile feature. Example usage: - python audio_profile.py --text "hello" --effects_profile_id "telephony-class-application" + python audio_profile.py --text "hello" --effects_profile_id + "telephony-class-application" """ import argparse @@ -52,10 +53,15 @@ def synthesize_text(text, output, effects_profile_id): if __name__ == '__main__': - parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--text', help='The text from which to synthesize speech.') - parser.add_argument('--output', help='The output mp3 file.') - parser.add_argument('--effects_profile_id', help='The audio effects profile id to be applied.') + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('--text', + help='The text from which to synthesize speech.') + parser.add_argument('--output', + help='The output mp3 file.') + parser.add_argument('--effects_profile_id', + help='The audio effects profile id to be applied.') args = parser.parse_args() From 8fe9b3d315552f404354c991a8adf27e54955ef5 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 15:54:49 -0700 Subject: [PATCH 03/16] Adjusted the row length --- texttospeech/cloud-client/audio_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index cf15c1735fb..19833a186d5 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -14,7 +14,7 @@ # 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 feature. +"""Google Cloud Text-To-Speech API sample application for audio profile. Example usage: python audio_profile.py --text "hello" --effects_profile_id From a0a2d24d6bddd68ff8b18453910a6467bd00795b Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 16:01:53 -0700 Subject: [PATCH 04/16] Fixed Import orders --- texttospeech/cloud-client/audio_profile.py | 1 + texttospeech/cloud-client/audio_profile_test.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 19833a186d5..4e8a8aaa908 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -22,6 +22,7 @@ """ import argparse + from google.cloud import texttospeech_v1beta1 as texttospeech diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index b796e6e28bc..7bb9026df27 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -11,10 +11,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import audio_profile import os import os.path +import audio_profile + TEXT = 'hello' OUTOUT = 'output.mp3' EFFECTS_PROFILE_ID = 'telephony-class-application' From f57d06a571d11848c00b00fbbad166cae23ddff3 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 16:07:14 -0700 Subject: [PATCH 05/16] Fixed print statement --- texttospeech/cloud-client/audio_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 4e8a8aaa908..13aafda8501 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -48,7 +48,7 @@ def synthesize_text(text, output, effects_profile_id): # 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 + print('Audio content written to file "%s"' % output) # [END tts_synthesize_text] From 26160755c2032dd9f1778ba750e49434b83862d9 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 16:13:30 -0700 Subject: [PATCH 06/16] Debugging the unit test --- texttospeech/cloud-client/audio_profile_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index 7bb9026df27..86473956158 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -22,11 +22,9 @@ def test_audio_profile(capsys): - if os.path.exists(OUTOUT): - os.remove(OUTOUT) - assert not os.path.exists(OUTOUT) audio_profile.synthesize_text(TEXT, OUTOUT, EFFECTS_PROFILE_ID) out, err = capsys.readouterr() - assert ('Audio content written to "%s"' % OUTOUT) in out + print(str(out)) + # assert ('Audio content written to "%s"' % OUTOUT) in out assert os.path.exists(OUTOUT) From 7bc5b371ea5d6c34aa361677c018ad4f63661a6c Mon Sep 17 00:00:00 2001 From: happyhuman Date: Thu, 21 Jun 2018 16:29:50 -0700 Subject: [PATCH 07/16] Fixed the unit test --- texttospeech/cloud-client/audio_profile_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index 86473956158..f3248a4c1ae 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -22,9 +22,11 @@ def test_audio_profile(capsys): + if os.path.exists(OUTOUT): + os.remove(OUTOUT) + assert not os.path.exists(OUTOUT) audio_profile.synthesize_text(TEXT, OUTOUT, EFFECTS_PROFILE_ID) out, err = capsys.readouterr() - print(str(out)) - # assert ('Audio content written to "%s"' % OUTOUT) in out + assert ('Audio content written to file "%s"' % OUTOUT) in out assert os.path.exists(OUTOUT) From 84832443b801caae3bfcf95552c072fe75a5ae45 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 2 Jul 2018 09:30:31 -0700 Subject: [PATCH 08/16] Some fixes per Noah's suggestions. --- texttospeech/cloud-client/audio_profile_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index f3248a4c1ae..1a26ebb3130 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -30,3 +30,4 @@ def test_audio_profile(capsys): assert ('Audio content written to file "%s"' % OUTOUT) in out assert os.path.exists(OUTOUT) + os.remove(OUTOUT) From 19da528af53b487f1d6e943d91bf87ff5e9fd251 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 2 Jul 2018 10:19:36 -0700 Subject: [PATCH 09/16] Renamed the function name in the test. --- texttospeech/cloud-client/audio_profile_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index 1a26ebb3130..702892fcb7a 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -25,7 +25,7 @@ def test_audio_profile(capsys): if os.path.exists(OUTOUT): os.remove(OUTOUT) assert not os.path.exists(OUTOUT) - audio_profile.synthesize_text(TEXT, OUTOUT, EFFECTS_PROFILE_ID) + audio_profile.synthesize_text_with_audio_profile(TEXT, OUTOUT, EFFECTS_PROFILE_ID) out, err = capsys.readouterr() assert ('Audio content written to file "%s"' % OUTOUT) in out From d4d613569a90eb1a225fbb548afd06e06bfce382 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 2 Jul 2018 11:33:40 -0700 Subject: [PATCH 10/16] Multilined the long line. --- texttospeech/cloud-client/audio_profile_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index 702892fcb7a..3e1adc6ebbe 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -25,7 +25,8 @@ def test_audio_profile(capsys): if os.path.exists(OUTOUT): os.remove(OUTOUT) assert not os.path.exists(OUTOUT) - audio_profile.synthesize_text_with_audio_profile(TEXT, OUTOUT, EFFECTS_PROFILE_ID) + audio_profile.synthesize_text_with_audio_profile(TEXT, OUTOUT, + EFFECTS_PROFILE_ID) out, err = capsys.readouterr() assert ('Audio content written to file "%s"' % OUTOUT) in out From 3c068e6f98b7217d19c6747d8a5017371b076416 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 2 Jul 2018 11:56:13 -0700 Subject: [PATCH 11/16] Fixed the misspelling --- texttospeech/cloud-client/audio_profile.py | 12 ++++++------ texttospeech/cloud-client/audio_profile_test.py | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 13aafda8501..5011f8deb8e 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -23,12 +23,12 @@ import argparse -from google.cloud import texttospeech_v1beta1 as texttospeech - -# [START tts_synthesize_text] -def synthesize_text(text, output, effects_profile_id): +# [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) @@ -50,7 +50,7 @@ def synthesize_text(text, output, effects_profile_id): out.write(response.audio_content) print('Audio content written to file "%s"' % output) -# [END tts_synthesize_text] +# [END tts_synthesize_text_with_audio_profile] if __name__ == '__main__': @@ -66,4 +66,4 @@ def synthesize_text(text, output, effects_profile_id): args = parser.parse_args() - synthesize_text(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/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index 3e1adc6ebbe..b8f46ca1472 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -17,18 +17,18 @@ import audio_profile TEXT = 'hello' -OUTOUT = 'output.mp3' +OUTPUT = 'output.mp3' EFFECTS_PROFILE_ID = 'telephony-class-application' def test_audio_profile(capsys): - if os.path.exists(OUTOUT): - os.remove(OUTOUT) - assert not os.path.exists(OUTOUT) - audio_profile.synthesize_text_with_audio_profile(TEXT, OUTOUT, + 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"' % OUTOUT) in out - assert os.path.exists(OUTOUT) - os.remove(OUTOUT) + assert ('Audio content written to file "%s"' % OUTPUT) in out + assert os.path.exists(OUTPUT) + os.remove(OUTPUT) From dc88c501b27b1d253e4c043b7ad65ac5ce32fe62 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 2 Jul 2018 12:29:24 -0700 Subject: [PATCH 12/16] Fixed the long line --- texttospeech/cloud-client/audio_profile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 5011f8deb8e..26c17b22c0b 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -66,4 +66,5 @@ def synthesize_text_with_audio_profile(text, output, effects_profile_id): 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) From f7adbf4b646694dce6bffce7cd946050b1b0df14 Mon Sep 17 00:00:00 2001 From: Shahin Saadati Date: Fri, 6 Jul 2018 14:35:24 -0700 Subject: [PATCH 13/16] Forcing the CicleCi to build again --- texttospeech/cloud-client/audio_profile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index 26c17b22c0b..caf99a3b709 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -57,10 +57,10 @@ def synthesize_text_with_audio_profile(text, output, effects_profile_id): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('--text', - help='The text from which to synthesize speech.') 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.') From 2d3d3d7ea1e103e99dcc1a79f1bc9cd2453bf939 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 9 Jul 2018 11:31:15 -0700 Subject: [PATCH 14/16] Changing Inc to LLC --- texttospeech/cloud-client/audio_profile.py | 2 +- texttospeech/cloud-client/audio_profile_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/texttospeech/cloud-client/audio_profile.py b/texttospeech/cloud-client/audio_profile.py index caf99a3b709..c616f710026 100644 --- a/texttospeech/cloud-client/audio_profile.py +++ b/texttospeech/cloud-client/audio_profile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2018 Google Inc. All Rights Reserved. +# 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. diff --git a/texttospeech/cloud-client/audio_profile_test.py b/texttospeech/cloud-client/audio_profile_test.py index b8f46ca1472..43a30bf06d1 100644 --- a/texttospeech/cloud-client/audio_profile_test.py +++ b/texttospeech/cloud-client/audio_profile_test.py @@ -1,4 +1,4 @@ -# Copyright 2018, Google, Inc. +# 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 From 7b2c8c788be61dfa187fd2c003aa230990e79c25 Mon Sep 17 00:00:00 2001 From: happyhuman Date: Mon, 9 Jul 2018 11:49:09 -0700 Subject: [PATCH 15/16] Updated library version. --- texttospeech/cloud-client/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttospeech/cloud-client/requirements.txt b/texttospeech/cloud-client/requirements.txt index 4fd188de740..597306701ec 100644 --- a/texttospeech/cloud-client/requirements.txt +++ b/texttospeech/cloud-client/requirements.txt @@ -1 +1 @@ -google-cloud-texttospeech==0.1.0 +google-cloud-texttospeech==0.2.0 From 6c80e2d9015f15e62130402f65b31a60176ac2ed Mon Sep 17 00:00:00 2001 From: happyhuman Date: Wed, 11 Jul 2018 10:39:44 -0700 Subject: [PATCH 16/16] Generated README.rst --- texttospeech/cloud-client/README.rst | 37 ++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/texttospeech/cloud-client/README.rst b/texttospeech/cloud-client/README.rst index 463b006ae85..7b877be1328 100644 --- a/texttospeech/cloud-client/README.rst +++ b/texttospeech/cloud-client/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