1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/dialogflow/v2/audio_config.proto 18 19 package com.google.cloud.dialogflow.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * Audio encoding of the audio content sent in the conversational query request. 26 * Refer to the 27 * [Cloud Speech API 28 * documentation](https://cloud.google.com/speech-to-text/docs/basics) for more 29 * details. 30 * </pre> 31 * 32 * Protobuf enum {@code google.cloud.dialogflow.v2.AudioEncoding} 33 */ 34 public enum AudioEncoding implements com.google.protobuf.ProtocolMessageEnum { 35 /** 36 * 37 * 38 * <pre> 39 * Not specified. 40 * </pre> 41 * 42 * <code>AUDIO_ENCODING_UNSPECIFIED = 0;</code> 43 */ 44 AUDIO_ENCODING_UNSPECIFIED(0), 45 /** 46 * 47 * 48 * <pre> 49 * Uncompressed 16-bit signed little-endian samples (Linear PCM). 50 * </pre> 51 * 52 * <code>AUDIO_ENCODING_LINEAR_16 = 1;</code> 53 */ 54 AUDIO_ENCODING_LINEAR_16(1), 55 /** 56 * 57 * 58 * <pre> 59 * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio 60 * Codec) is the recommended encoding because it is lossless (therefore 61 * recognition is not compromised) and requires only about half the 62 * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 63 * 24-bit samples, however, not all fields in `STREAMINFO` are supported. 64 * </pre> 65 * 66 * <code>AUDIO_ENCODING_FLAC = 2;</code> 67 */ 68 AUDIO_ENCODING_FLAC(2), 69 /** 70 * 71 * 72 * <pre> 73 * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. 74 * </pre> 75 * 76 * <code>AUDIO_ENCODING_MULAW = 3;</code> 77 */ 78 AUDIO_ENCODING_MULAW(3), 79 /** 80 * 81 * 82 * <pre> 83 * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. 84 * </pre> 85 * 86 * <code>AUDIO_ENCODING_AMR = 4;</code> 87 */ 88 AUDIO_ENCODING_AMR(4), 89 /** 90 * 91 * 92 * <pre> 93 * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. 94 * </pre> 95 * 96 * <code>AUDIO_ENCODING_AMR_WB = 5;</code> 97 */ 98 AUDIO_ENCODING_AMR_WB(5), 99 /** 100 * 101 * 102 * <pre> 103 * Opus encoded audio frames in Ogg container 104 * ([OggOpus](https://wiki.xiph.org/OggOpus)). 105 * `sample_rate_hertz` must be 16000. 106 * </pre> 107 * 108 * <code>AUDIO_ENCODING_OGG_OPUS = 6;</code> 109 */ 110 AUDIO_ENCODING_OGG_OPUS(6), 111 /** 112 * 113 * 114 * <pre> 115 * Although the use of lossy encodings is not recommended, if a very low 116 * bitrate encoding is required, `OGG_OPUS` is highly preferred over 117 * Speex encoding. The [Speex](https://speex.org/) encoding supported by 118 * Dialogflow API has a header byte in each block, as in MIME type 119 * `audio/x-speex-with-header-byte`. 120 * It is a variant of the RTP Speex encoding defined in 121 * [RFC 5574](https://tools.ietf.org/html/rfc5574). 122 * The stream is a sequence of blocks, one block per RTP packet. Each block 123 * starts with a byte containing the length of the block, in bytes, followed 124 * by one or more frames of Speex data, padded to an integral number of 125 * bytes (octets) as specified in RFC 5574. In other words, each RTP header 126 * is replaced with a single byte containing the block length. Only Speex 127 * wideband is supported. `sample_rate_hertz` must be 16000. 128 * </pre> 129 * 130 * <code>AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;</code> 131 */ 132 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE(7), 133 UNRECOGNIZED(-1), 134 ; 135 136 /** 137 * 138 * 139 * <pre> 140 * Not specified. 141 * </pre> 142 * 143 * <code>AUDIO_ENCODING_UNSPECIFIED = 0;</code> 144 */ 145 public static final int AUDIO_ENCODING_UNSPECIFIED_VALUE = 0; 146 /** 147 * 148 * 149 * <pre> 150 * Uncompressed 16-bit signed little-endian samples (Linear PCM). 151 * </pre> 152 * 153 * <code>AUDIO_ENCODING_LINEAR_16 = 1;</code> 154 */ 155 public static final int AUDIO_ENCODING_LINEAR_16_VALUE = 1; 156 /** 157 * 158 * 159 * <pre> 160 * [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio 161 * Codec) is the recommended encoding because it is lossless (therefore 162 * recognition is not compromised) and requires only about half the 163 * bandwidth of `LINEAR16`. `FLAC` stream encoding supports 16-bit and 164 * 24-bit samples, however, not all fields in `STREAMINFO` are supported. 165 * </pre> 166 * 167 * <code>AUDIO_ENCODING_FLAC = 2;</code> 168 */ 169 public static final int AUDIO_ENCODING_FLAC_VALUE = 2; 170 /** 171 * 172 * 173 * <pre> 174 * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. 175 * </pre> 176 * 177 * <code>AUDIO_ENCODING_MULAW = 3;</code> 178 */ 179 public static final int AUDIO_ENCODING_MULAW_VALUE = 3; 180 /** 181 * 182 * 183 * <pre> 184 * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. 185 * </pre> 186 * 187 * <code>AUDIO_ENCODING_AMR = 4;</code> 188 */ 189 public static final int AUDIO_ENCODING_AMR_VALUE = 4; 190 /** 191 * 192 * 193 * <pre> 194 * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. 195 * </pre> 196 * 197 * <code>AUDIO_ENCODING_AMR_WB = 5;</code> 198 */ 199 public static final int AUDIO_ENCODING_AMR_WB_VALUE = 5; 200 /** 201 * 202 * 203 * <pre> 204 * Opus encoded audio frames in Ogg container 205 * ([OggOpus](https://wiki.xiph.org/OggOpus)). 206 * `sample_rate_hertz` must be 16000. 207 * </pre> 208 * 209 * <code>AUDIO_ENCODING_OGG_OPUS = 6;</code> 210 */ 211 public static final int AUDIO_ENCODING_OGG_OPUS_VALUE = 6; 212 /** 213 * 214 * 215 * <pre> 216 * Although the use of lossy encodings is not recommended, if a very low 217 * bitrate encoding is required, `OGG_OPUS` is highly preferred over 218 * Speex encoding. The [Speex](https://speex.org/) encoding supported by 219 * Dialogflow API has a header byte in each block, as in MIME type 220 * `audio/x-speex-with-header-byte`. 221 * It is a variant of the RTP Speex encoding defined in 222 * [RFC 5574](https://tools.ietf.org/html/rfc5574). 223 * The stream is a sequence of blocks, one block per RTP packet. Each block 224 * starts with a byte containing the length of the block, in bytes, followed 225 * by one or more frames of Speex data, padded to an integral number of 226 * bytes (octets) as specified in RFC 5574. In other words, each RTP header 227 * is replaced with a single byte containing the block length. Only Speex 228 * wideband is supported. `sample_rate_hertz` must be 16000. 229 * </pre> 230 * 231 * <code>AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;</code> 232 */ 233 public static final int AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE_VALUE = 7; 234 getNumber()235 public final int getNumber() { 236 if (this == UNRECOGNIZED) { 237 throw new java.lang.IllegalArgumentException( 238 "Can't get the number of an unknown enum value."); 239 } 240 return value; 241 } 242 243 /** 244 * @param value The numeric wire value of the corresponding enum entry. 245 * @return The enum associated with the given numeric wire value. 246 * @deprecated Use {@link #forNumber(int)} instead. 247 */ 248 @java.lang.Deprecated valueOf(int value)249 public static AudioEncoding valueOf(int value) { 250 return forNumber(value); 251 } 252 253 /** 254 * @param value The numeric wire value of the corresponding enum entry. 255 * @return The enum associated with the given numeric wire value. 256 */ forNumber(int value)257 public static AudioEncoding forNumber(int value) { 258 switch (value) { 259 case 0: 260 return AUDIO_ENCODING_UNSPECIFIED; 261 case 1: 262 return AUDIO_ENCODING_LINEAR_16; 263 case 2: 264 return AUDIO_ENCODING_FLAC; 265 case 3: 266 return AUDIO_ENCODING_MULAW; 267 case 4: 268 return AUDIO_ENCODING_AMR; 269 case 5: 270 return AUDIO_ENCODING_AMR_WB; 271 case 6: 272 return AUDIO_ENCODING_OGG_OPUS; 273 case 7: 274 return AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE; 275 default: 276 return null; 277 } 278 } 279 internalGetValueMap()280 public static com.google.protobuf.Internal.EnumLiteMap<AudioEncoding> internalGetValueMap() { 281 return internalValueMap; 282 } 283 284 private static final com.google.protobuf.Internal.EnumLiteMap<AudioEncoding> internalValueMap = 285 new com.google.protobuf.Internal.EnumLiteMap<AudioEncoding>() { 286 public AudioEncoding findValueByNumber(int number) { 287 return AudioEncoding.forNumber(number); 288 } 289 }; 290 getValueDescriptor()291 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 292 if (this == UNRECOGNIZED) { 293 throw new java.lang.IllegalStateException( 294 "Can't get the descriptor of an unrecognized enum value."); 295 } 296 return getDescriptor().getValues().get(ordinal()); 297 } 298 getDescriptorForType()299 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 300 return getDescriptor(); 301 } 302 getDescriptor()303 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 304 return com.google.cloud.dialogflow.v2.AudioConfigProto.getDescriptor().getEnumTypes().get(0); 305 } 306 307 private static final AudioEncoding[] VALUES = values(); 308 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)309 public static AudioEncoding valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 310 if (desc.getType() != getDescriptor()) { 311 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 312 } 313 if (desc.getIndex() == -1) { 314 return UNRECOGNIZED; 315 } 316 return VALUES[desc.getIndex()]; 317 } 318 319 private final int value; 320 AudioEncoding(int value)321 private AudioEncoding(int value) { 322 this.value = value; 323 } 324 325 // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.AudioEncoding) 326 } 327