Skip to content

Commit

Permalink
feat: [google-cloud-speech] expand the set of supported explicit audi…
Browse files Browse the repository at this point in the history
…o encodings (#13380)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: expand the set of supported explicit audio encodings
docs: updated ExplicitDecodingConfig documentation to reflect changes
related to newly supported encodings
END_COMMIT_OVERRIDE


PiperOrigin-RevId: 708316885

Source-Link:
googleapis/googleapis@bf2a7ca

Source-Link:
googleapis/googleapis-gen@4989c73
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiNDk4OWM3MzQ2OWZlYTI4ZTUxODFlOTYxYTgzYWZmZmY3MGI4NDNiNCJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Dec 23, 2024
1 parent 5db8939 commit 6ddf897
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.29.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.29.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.29.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.29.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -809,29 +809,21 @@ class ExplicitDecodingConfig(proto.Message):
Required. Encoding of the audio data sent for
recognition.
sample_rate_hertz (int):
Sample rate in Hertz of the audio data sent for recognition.
Valid values are: 8000-48000. 16000 is optimal. For best
results, set the sampling rate of the audio source to 16000
Hz. If that's not possible, use the native sample rate of
the audio source (instead of re-sampling). Supported for the
following encodings:
- LINEAR16: Headerless 16-bit signed little-endian PCM
samples.
- MULAW: Headerless 8-bit companded mulaw samples.
- ALAW: Headerless 8-bit companded alaw samples.
Optional. Sample rate in Hertz of the audio
data sent for recognition. Valid values are:
8000-48000. 16000 is optimal. For best results,
set the sampling rate of the audio source to
16000 Hz. If that's not possible, use the native
sample rate of the audio source (instead of
re-sampling). Note that this field is marked as
OPTIONAL for backward compatibility reasons. It
is (and has always been) effectively REQUIRED.
audio_channel_count (int):
Number of channels present in the audio data sent for
recognition. Supported for the following encodings:
- LINEAR16: Headerless 16-bit signed little-endian PCM
samples.
- MULAW: Headerless 8-bit companded mulaw samples.
- ALAW: Headerless 8-bit companded alaw samples.
Optional. Number of channels present in the
audio data sent for recognition. Note that this
field is marked as OPTIONAL for backward
compatibility reasons. It is (and has always
been) effectively REQUIRED.
The maximum allowed value is 8.
"""
Expand All @@ -849,11 +841,40 @@ class AudioEncoding(proto.Enum):
Headerless 8-bit companded mulaw samples.
ALAW (3):
Headerless 8-bit companded alaw samples.
AMR (4):
AMR frames with an rfc4867.5 header.
AMR_WB (5):
AMR-WB frames with an rfc4867.5 header.
FLAC (6):
FLAC frames in the "native FLAC" container
format.
MP3 (7):
MPEG audio frames with optional (ignored) ID3
metadata.
OGG_OPUS (8):
Opus audio frames in an Ogg container.
WEBM_OPUS (9):
Opus audio frames in a WebM container.
MP4_AAC (10):
AAC audio frames in an MP4 container.
M4A_AAC (11):
AAC audio frames in an M4A container.
MOV_AAC (12):
AAC audio frames in an MOV container.
"""
AUDIO_ENCODING_UNSPECIFIED = 0
LINEAR16 = 1
MULAW = 2
ALAW = 3
AMR = 4
AMR_WB = 5
FLAC = 6
MP3 = 7
OGG_OPUS = 8
WEBM_OPUS = 9
MP4_AAC = 10
M4A_AAC = 11
MOV_AAC = 12

encoding: AudioEncoding = proto.Field(
proto.ENUM,
Expand Down Expand Up @@ -1871,16 +1892,16 @@ class OutputFormatConfig(proto.Message):
native (google.cloud.speech_v2.types.NativeOutputFileFormatConfig):
Configuration for the native output format.
If this field is set or if no other output
format field is set then transcripts will be
format field is set, then transcripts will be
written to the sink in the native format.
vtt (google.cloud.speech_v2.types.VttOutputFileFormatConfig):
Configuration for the vtt output format. If
this field is set then transcripts will be
written to the sink in the vtt format.
Configuration for the VTT output format. If
this field is set, then transcripts will be
written to the sink in the VTT format.
srt (google.cloud.speech_v2.types.SrtOutputFileFormatConfig):
Configuration for the srt output format. If
this field is set then transcripts will be
written to the sink in the srt format.
Configuration for the SRT output format. If
this field is set, then transcripts will be
written to the sink in the SRT format.
"""

native: "NativeOutputFileFormatConfig" = proto.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-speech",
"version": "2.29.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-speech",
"version": "2.29.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-speech",
"version": "2.29.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 6ddf897

Please sign in to comment.