diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py index b3ce05f02d94..a4209fbbc112 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech/__init__.py @@ -41,6 +41,7 @@ ListVoicesResponse, MultiSpeakerMarkup, SsmlVoiceGender, + StreamingAudioConfig, StreamingSynthesisInput, StreamingSynthesizeConfig, StreamingSynthesizeRequest, @@ -71,6 +72,7 @@ "ListVoicesRequest", "ListVoicesResponse", "MultiSpeakerMarkup", + "StreamingAudioConfig", "StreamingSynthesisInput", "StreamingSynthesizeConfig", "StreamingSynthesizeRequest", diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech/gapic_version.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech/gapic_version.py index 411b87d337df..558c8aab67c5 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech/gapic_version.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.23.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py index 6fac6f5295a5..6ae42e258b91 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/__init__.py @@ -34,6 +34,7 @@ ListVoicesResponse, MultiSpeakerMarkup, SsmlVoiceGender, + StreamingAudioConfig, StreamingSynthesisInput, StreamingSynthesizeConfig, StreamingSynthesizeRequest, @@ -64,6 +65,7 @@ "ListVoicesResponse", "MultiSpeakerMarkup", "SsmlVoiceGender", + "StreamingAudioConfig", "StreamingSynthesisInput", "StreamingSynthesizeConfig", "StreamingSynthesizeRequest", diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_version.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_version.py index 411b87d337df..558c8aab67c5 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_version.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.23.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py index ed9024599859..8fb261a432b3 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/async_client.py @@ -434,7 +434,7 @@ async def sample_synthesize_speech(): voice.language_code = "language_code_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" request = texttospeech_v1.SynthesizeSpeechRequest( input=input, diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/client.py index edcc85a61104..258fd712df2d 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech/client.py @@ -823,7 +823,7 @@ def sample_synthesize_speech(): voice.language_code = "language_code_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" request = texttospeech_v1.SynthesizeSpeechRequest( input=input, diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py index ac6dd1098e35..f1d86f00cc03 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/async_client.py @@ -339,7 +339,7 @@ async def sample_synthesize_long_audio(): input.text = "text_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" voice = texttospeech_v1.VoiceSelectionParams() voice.language_code = "language_code_value" diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py index 863c49ad34b2..027ba7ffe7e7 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/services/text_to_speech_long_audio_synthesize/client.py @@ -738,7 +738,7 @@ def sample_synthesize_long_audio(): input.text = "text_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" voice = texttospeech_v1.VoiceSelectionParams() voice.language_code = "language_code_value" diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/__init__.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/__init__.py index 884fecfd203e..0e4aa102a57e 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/__init__.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/__init__.py @@ -24,6 +24,7 @@ ListVoicesResponse, MultiSpeakerMarkup, SsmlVoiceGender, + StreamingAudioConfig, StreamingSynthesisInput, StreamingSynthesizeConfig, StreamingSynthesizeRequest, @@ -50,6 +51,7 @@ "ListVoicesRequest", "ListVoicesResponse", "MultiSpeakerMarkup", + "StreamingAudioConfig", "StreamingSynthesisInput", "StreamingSynthesizeConfig", "StreamingSynthesizeRequest", diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py index d1fe78111472..eeb4e453a7e0 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1/types/cloud_tts.py @@ -38,6 +38,7 @@ "CustomVoiceParams", "VoiceCloneParams", "SynthesizeSpeechResponse", + "StreamingAudioConfig", "StreamingSynthesizeConfig", "StreamingSynthesisInput", "StreamingSynthesizeRequest", @@ -103,6 +104,11 @@ class AudioEncoding(proto.Enum): 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. Audio content returned as ALAW also contains a WAV header. + PCM (7): + Uncompressed 16-bit signed little-endian + samples (Linear PCM). Note that as opposed to + LINEAR16, audio will not be wrapped in a WAV (or + any other) header. """ AUDIO_ENCODING_UNSPECIFIED = 0 LINEAR16 = 1 @@ -110,6 +116,7 @@ class AudioEncoding(proto.Enum): OGG_OPUS = 3 MULAW = 5 ALAW = 6 + PCM = 7 class ListVoicesRequest(proto.Message): @@ -657,6 +664,30 @@ class SynthesizeSpeechResponse(proto.Message): ) +class StreamingAudioConfig(proto.Message): + r"""Description of the desired output audio data. + + Attributes: + audio_encoding (google.cloud.texttospeech_v1.types.AudioEncoding): + Required. The format of the audio byte stream. For now, + streaming only supports PCM and OGG_OPUS. All other + encodings will return an error. + sample_rate_hertz (int): + Optional. The synthesis sample rate (in + hertz) for this audio. + """ + + audio_encoding: "AudioEncoding" = proto.Field( + proto.ENUM, + number=1, + enum="AudioEncoding", + ) + sample_rate_hertz: int = proto.Field( + proto.INT32, + number=2, + ) + + class StreamingSynthesizeConfig(proto.Message): r"""Provides configuration information for the StreamingSynthesize request. @@ -665,6 +696,9 @@ class StreamingSynthesizeConfig(proto.Message): voice (google.cloud.texttospeech_v1.types.VoiceSelectionParams): Required. The desired voice of the synthesized audio. + streaming_audio_config (google.cloud.texttospeech_v1.types.StreamingAudioConfig): + Optional. The configuration of the + synthesized audio. """ voice: "VoiceSelectionParams" = proto.Field( @@ -672,6 +706,11 @@ class StreamingSynthesizeConfig(proto.Message): number=1, message="VoiceSelectionParams", ) + streaming_audio_config: "StreamingAudioConfig" = proto.Field( + proto.MESSAGE, + number=4, + message="StreamingAudioConfig", + ) class StreamingSynthesisInput(proto.Message): diff --git a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/gapic_version.py b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/gapic_version.py index 411b87d337df..558c8aab67c5 100644 --- a/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/gapic_version.py +++ b/packages/google-cloud-texttospeech/google/cloud/texttospeech_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.23.0" # {x-release-please-version} +__version__ = "0.0.0" # {x-release-please-version} diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json b/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json index 6f025c7d2765..5b86979204f3 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json +++ b/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-texttospeech", - "version": "2.23.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json index 7cf87b7a08f2..1494a35ba1c6 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ b/packages/google-cloud-texttospeech/samples/generated_samples/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-texttospeech", - "version": "2.23.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py index 9a5f80c775f7..1d189ed1ba49 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_async.py @@ -43,7 +43,7 @@ async def sample_synthesize_long_audio(): input.text = "text_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" voice = texttospeech_v1.VoiceSelectionParams() voice.language_code = "language_code_value" diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_sync.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_sync.py index 3e903a4fa7c0..ca347e825a3e 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_sync.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_long_audio_synthesize_synthesize_long_audio_sync.py @@ -43,7 +43,7 @@ def sample_synthesize_long_audio(): input.text = "text_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" voice = texttospeech_v1.VoiceSelectionParams() voice.language_code = "language_code_value" diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_async.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_async.py index dd9255013bfd..af1459262dea 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_async.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_async.py @@ -46,7 +46,7 @@ async def sample_synthesize_speech(): voice.language_code = "language_code_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" request = texttospeech_v1.SynthesizeSpeechRequest( input=input, diff --git a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_sync.py b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_sync.py index 8b8a0e8d59b1..edf2fc64a586 100644 --- a/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_sync.py +++ b/packages/google-cloud-texttospeech/samples/generated_samples/texttospeech_v1_generated_text_to_speech_synthesize_speech_sync.py @@ -46,7 +46,7 @@ def sample_synthesize_speech(): voice.language_code = "language_code_value" audio_config = texttospeech_v1.AudioConfig() - audio_config.audio_encoding = "ALAW" + audio_config.audio_encoding = "PCM" request = texttospeech_v1.SynthesizeSpeechRequest( input=input,