|
| 1 | +# Copyright 2018 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +"""Wrappers for protocol buffer enum types.""" |
| 15 | + |
| 16 | +import enum |
| 17 | + |
| 18 | + |
| 19 | +class SsmlVoiceGender(enum.IntEnum): |
| 20 | + """ |
| 21 | + Gender of the voice as described in |
| 22 | + `SSML voice element <https://www.w3.org/TR/speech-synthesis11/#edef_voice>`_. |
| 23 | +
|
| 24 | + Attributes: |
| 25 | + SSML_VOICE_GENDER_UNSPECIFIED (int): An unspecified gender. |
| 26 | + In VoiceSelectionParams, this means that the client doesn't care which |
| 27 | + gender the selected voice will have. In the Voice field of |
| 28 | + ListVoicesResponse, this may mean that the voice doesn't fit any of the |
| 29 | + other categories in this enum, or that the gender of the voice isn't known. |
| 30 | + MALE (int): A male voice. |
| 31 | + FEMALE (int): A female voice. |
| 32 | + NEUTRAL (int): A gender-neutral voice. |
| 33 | + """ |
| 34 | + SSML_VOICE_GENDER_UNSPECIFIED = 0 |
| 35 | + MALE = 1 |
| 36 | + FEMALE = 2 |
| 37 | + NEUTRAL = 3 |
| 38 | + |
| 39 | + |
| 40 | +class AudioEncoding(enum.IntEnum): |
| 41 | + """ |
| 42 | + Configuration to set up audio encoder. The encoding determines the output |
| 43 | + audio format that we'd like. |
| 44 | +
|
| 45 | + Attributes: |
| 46 | + AUDIO_ENCODING_UNSPECIFIED (int): Not specified. Will return result ``google.rpc.Code.INVALID_ARGUMENT``. |
| 47 | + LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). |
| 48 | + Audio content returned as LINEAR16 also contains a WAV header. |
| 49 | + MP3 (int): MP3 audio. |
| 50 | + OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a |
| 51 | + file which can be played natively on Android, and in browsers (at least |
| 52 | + Chrome and Firefox). The quality of the encoding is considerably higher |
| 53 | + than MP3 while using approximately the same bitrate. |
| 54 | + """ |
| 55 | + AUDIO_ENCODING_UNSPECIFIED = 0 |
| 56 | + LINEAR16 = 1 |
| 57 | + MP3 = 2 |
| 58 | + OGG_OPUS = 3 |
0 commit comments