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

com.google.api.services.speech.v1beta1.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://code.google.com/p/google-apis-client-generator/
 * (build: 2017-02-15 17:18:02 UTC)
 * on 2017-04-08 at 18:29:03 UTC 
 * Modify at your own risk.
 */

package com.google.api.services.speech.v1beta1.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 Google Cloud Speech API. For a detailed explanation * see: * http://code.google.com/p/google-http-java-client/wiki/JSON *

* * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class RecognitionConfig extends com.google.api.client.json.GenericJson { /** * *Required* Encoding of audio data sent in all `RecognitionAudio` messages. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.String encoding; /** * *Optional* The language of the supplied audio as a BCP-47 language tag. Example: "en-GB" * https://www.rfc-editor.org/rfc/bcp/bcp47.txt If omitted, defaults to "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; /** * *Required* 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). * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer sampleRate; /** * *Optional* A means to provide context to assist the speech recognition. * The value may be {@code null}. */ @com.google.api.client.util.Key private SpeechContext speechContext; /** * *Required* Encoding of audio data sent in all `RecognitionAudio` messages. * @return value or {@code null} for none */ public java.lang.String getEncoding() { return encoding; } /** * *Required* Encoding of audio data sent in all `RecognitionAudio` messages. * @param encoding encoding or {@code null} for none */ public RecognitionConfig setEncoding(java.lang.String encoding) { this.encoding = encoding; return this; } /** * *Optional* The language of the supplied audio as a BCP-47 language tag. Example: "en-GB" * https://www.rfc-editor.org/rfc/bcp/bcp47.txt If omitted, defaults to "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; } /** * *Optional* The language of the supplied audio as a BCP-47 language tag. Example: "en-GB" * https://www.rfc-editor.org/rfc/bcp/bcp47.txt If omitted, defaults to "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; } /** * *Required* 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). * @return value or {@code null} for none */ public java.lang.Integer getSampleRate() { return sampleRate; } /** * *Required* 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). * @param sampleRate sampleRate or {@code null} for none */ public RecognitionConfig setSampleRate(java.lang.Integer sampleRate) { this.sampleRate = sampleRate; return this; } /** * *Optional* A means to provide context to assist the speech recognition. * @return value or {@code null} for none */ public SpeechContext getSpeechContext() { return speechContext; } /** * *Optional* A means to provide context to assist the speech recognition. * @param speechContext speechContext or {@code null} for none */ public RecognitionConfig setSpeechContext(SpeechContext speechContext) { this.speechContext = speechContext; 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