All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.api.services.speech.v1.model.RecognitionConfig Maven / Gradle / Ivy

/*
 * Copyright 2010 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.
 */
/*
 * This code was generated by https://github.com/google/apis-client-generator/
 * (build: 2018-05-04 17:28:03 UTC)
 * on 2018-05-22 at 02:56:32 UTC 
 * Modify at your own risk.
 */

package com.google.api.services.speech.v1.model;

/**
 * Provides information to the recognizer that specifies how to process the request.
 *
 * 

This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Cloud Speech API. For a detailed explanation see: * https://developers.google.com/api-client-library/java/google-http-java-client/json *

* * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class RecognitionConfig extends com.google.api.client.json.GenericJson { /** * *Optional* If `true`, the top result includes a list of words and the start and end time * offsets (timestamps) for those words. If `false`, no word-level time offset information is * returned. The default is `false`. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Boolean enableWordTimeOffsets; /** * Encoding of audio data sent in all `RecognitionAudio` messages. This field is optional for * `FLAC` and `WAV` audio files and required for all other audio formats. For details, see * AudioEncoding. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String encoding; /** * *Required* The language of the supplied audio as a [BCP-47](https://www.rfc- * editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language * Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported * language codes. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String languageCode; /** * *Optional* Maximum number of recognition hypotheses to be returned. Specifically, the maximum * number of `SpeechRecognitionAlternative` messages within each `SpeechRecognitionResult`. The * server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or * `1` will return a maximum of one. If omitted, will return a maximum of one. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer maxAlternatives; /** * *Optional* If set to `true`, the server will attempt to filter out profanities, replacing all * but the initial character in each filtered word with asterisks, e.g. "f***". If set to `false` * or omitted, profanities won't be filtered out. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Boolean profanityFilter; /** * Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages. 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). This field is optional for `FLAC` and `WAV` audio files and required for all * other audio formats. For details, see AudioEncoding. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer sampleRateHertz; /** * *Optional* A means to provide context to assist the speech recognition. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.util.List speechContexts; static { // hack to force ProGuard to consider SpeechContext used, since otherwise it would be stripped out // see https://github.com/google/google-api-java-client/issues/543 com.google.api.client.util.Data.nullOf(SpeechContext.class); } /** * *Optional* If `true`, the top result includes a list of words and the start and end time * offsets (timestamps) for those words. If `false`, no word-level time offset information is * returned. The default is `false`. * @return value or {@code null} for none */ public java.lang.Boolean getEnableWordTimeOffsets() { return enableWordTimeOffsets; } /** * *Optional* If `true`, the top result includes a list of words and the start and end time * offsets (timestamps) for those words. If `false`, no word-level time offset information is * returned. The default is `false`. * @param enableWordTimeOffsets enableWordTimeOffsets or {@code null} for none */ public RecognitionConfig setEnableWordTimeOffsets(java.lang.Boolean enableWordTimeOffsets) { this.enableWordTimeOffsets = enableWordTimeOffsets; return this; } /** * Encoding of audio data sent in all `RecognitionAudio` messages. This field is optional for * `FLAC` and `WAV` audio files and required for all other audio formats. For details, see * AudioEncoding. * @return value or {@code null} for none */ public java.lang.String getEncoding() { return encoding; } /** * Encoding of audio data sent in all `RecognitionAudio` messages. This field is optional for * `FLAC` and `WAV` audio files and required for all other audio formats. For details, see * AudioEncoding. * @param encoding encoding or {@code null} for none */ public RecognitionConfig setEncoding(java.lang.String encoding) { this.encoding = encoding; return this; } /** * *Required* The language of the supplied audio as a [BCP-47](https://www.rfc- * editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language * Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported * language codes. * @return value or {@code null} for none */ public java.lang.String getLanguageCode() { return languageCode; } /** * *Required* The language of the supplied audio as a [BCP-47](https://www.rfc- * editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language * Support](https://cloud.google.com/speech/docs/languages) for a list of the currently supported * language codes. * @param languageCode languageCode or {@code null} for none */ public RecognitionConfig setLanguageCode(java.lang.String languageCode) { this.languageCode = languageCode; return this; } /** * *Optional* Maximum number of recognition hypotheses to be returned. Specifically, the maximum * number of `SpeechRecognitionAlternative` messages within each `SpeechRecognitionResult`. The * server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or * `1` will return a maximum of one. If omitted, will return a maximum of one. * @return value or {@code null} for none */ public java.lang.Integer getMaxAlternatives() { return maxAlternatives; } /** * *Optional* Maximum number of recognition hypotheses to be returned. Specifically, the maximum * number of `SpeechRecognitionAlternative` messages within each `SpeechRecognitionResult`. The * server may return fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` or * `1` will return a maximum of one. If omitted, will return a maximum of one. * @param maxAlternatives maxAlternatives or {@code null} for none */ public RecognitionConfig setMaxAlternatives(java.lang.Integer maxAlternatives) { this.maxAlternatives = maxAlternatives; return this; } /** * *Optional* If set to `true`, the server will attempt to filter out profanities, replacing all * but the initial character in each filtered word with asterisks, e.g. "f***". If set to `false` * or omitted, profanities won't be filtered out. * @return value or {@code null} for none */ public java.lang.Boolean getProfanityFilter() { return profanityFilter; } /** * *Optional* If set to `true`, the server will attempt to filter out profanities, replacing all * but the initial character in each filtered word with asterisks, e.g. "f***". If set to `false` * or omitted, profanities won't be filtered out. * @param profanityFilter profanityFilter or {@code null} for none */ public RecognitionConfig setProfanityFilter(java.lang.Boolean profanityFilter) { this.profanityFilter = profanityFilter; return this; } /** * Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages. 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). This field is optional for `FLAC` and `WAV` audio files and required for all * other audio formats. For details, see AudioEncoding. * @return value or {@code null} for none */ public java.lang.Integer getSampleRateHertz() { return sampleRateHertz; } /** * Sample rate in Hertz of the audio data sent in all `RecognitionAudio` messages. 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). This field is optional for `FLAC` and `WAV` audio files and required for all * other audio formats. For details, see AudioEncoding. * @param sampleRateHertz sampleRateHertz or {@code null} for none */ public RecognitionConfig setSampleRateHertz(java.lang.Integer sampleRateHertz) { this.sampleRateHertz = sampleRateHertz; return this; } /** * *Optional* A means to provide context to assist the speech recognition. * @return value or {@code null} for none */ public java.util.List getSpeechContexts() { return speechContexts; } /** * *Optional* A means to provide context to assist the speech recognition. * @param speechContexts speechContexts or {@code null} for none */ public RecognitionConfig setSpeechContexts(java.util.List speechContexts) { this.speechContexts = speechContexts; return this; } @Override public RecognitionConfig set(String fieldName, Object value) { return (RecognitionConfig) super.set(fieldName, value); } @Override public RecognitionConfig clone() { return (RecognitionConfig) super.clone(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy