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://github.com/google/apis-client-generator/
 * (build: 2016-07-08 17:28:43 UTC)
 * on 2016-09-13 at 00:41:28 UTC 
 * Modify at your own risk.
 */

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

/**
 * The `RecognitionConfig` message 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: * 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] The number of interleaved channels in the input audio data. Valid values for * LINEAR16 and FLAC are `1`-`8`. Valid values for MULAW, AMR and AMR_WB are only `1`. If `0` or * omitted, defaults to one channel (mono). * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Integer audioChannels; /** * [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/best-practices#language_support) 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 `1`. If omitted, defaults to `1`. * 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; /** * [Optional] The number of interleaved channels in the input audio data. Valid values for * LINEAR16 and FLAC are `1`-`8`. Valid values for MULAW, AMR and AMR_WB are only `1`. If `0` or * omitted, defaults to one channel (mono). * @return value or {@code null} for none */ public java.lang.Integer getAudioChannels() { return audioChannels; } /** * [Optional] The number of interleaved channels in the input audio data. Valid values for * LINEAR16 and FLAC are `1`-`8`. Valid values for MULAW, AMR and AMR_WB are only `1`. If `0` or * omitted, defaults to one channel (mono). * @param audioChannels audioChannels or {@code null} for none */ public RecognitionConfig setAudioChannels(java.lang.Integer audioChannels) { this.audioChannels = audioChannels; return this; } /** * [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/best-practices#language_support) 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/best-practices#language_support) 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 `1`. If omitted, defaults to `1`. * @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 `1`. If omitted, defaults to `1`. * @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