@google-cloud/speech
Version:
Cloud Speech Client Library for Node.js
910 lines (736 loc) • 1.46 MB
TypeScript
// Copyright 2025 Google LLC
//
// 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.
import type {protobuf as $protobuf} from "google-gax";
import Long = require("long");
/** Namespace google. */
export namespace google {
/** Namespace cloud. */
namespace cloud {
/** Namespace speech. */
namespace speech {
/** Namespace v1. */
namespace v1 {
/** Represents a Speech */
class Speech extends $protobuf.rpc.Service {
/**
* Constructs a new Speech service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new Speech service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Speech;
/**
* Calls Recognize.
* @param request RecognizeRequest message or plain object
* @param callback Node-style callback called with the error, if any, and RecognizeResponse
*/
public recognize(request: google.cloud.speech.v1.IRecognizeRequest, callback: google.cloud.speech.v1.Speech.RecognizeCallback): void;
/**
* Calls Recognize.
* @param request RecognizeRequest message or plain object
* @returns Promise
*/
public recognize(request: google.cloud.speech.v1.IRecognizeRequest): Promise<google.cloud.speech.v1.RecognizeResponse>;
/**
* Calls LongRunningRecognize.
* @param request LongRunningRecognizeRequest message or plain object
* @param callback Node-style callback called with the error, if any, and Operation
*/
public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest, callback: google.cloud.speech.v1.Speech.LongRunningRecognizeCallback): void;
/**
* Calls LongRunningRecognize.
* @param request LongRunningRecognizeRequest message or plain object
* @returns Promise
*/
public longRunningRecognize(request: google.cloud.speech.v1.ILongRunningRecognizeRequest): Promise<google.longrunning.Operation>;
/**
* Calls StreamingRecognize.
* @param request StreamingRecognizeRequest message or plain object
* @param callback Node-style callback called with the error, if any, and StreamingRecognizeResponse
*/
public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest, callback: google.cloud.speech.v1.Speech.StreamingRecognizeCallback): void;
/**
* Calls StreamingRecognize.
* @param request StreamingRecognizeRequest message or plain object
* @returns Promise
*/
public streamingRecognize(request: google.cloud.speech.v1.IStreamingRecognizeRequest): Promise<google.cloud.speech.v1.StreamingRecognizeResponse>;
}
namespace Speech {
/**
* Callback as used by {@link google.cloud.speech.v1.Speech|recognize}.
* @param error Error, if any
* @param [response] RecognizeResponse
*/
type RecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.RecognizeResponse) => void;
/**
* Callback as used by {@link google.cloud.speech.v1.Speech|longRunningRecognize}.
* @param error Error, if any
* @param [response] Operation
*/
type LongRunningRecognizeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void;
/**
* Callback as used by {@link google.cloud.speech.v1.Speech|streamingRecognize}.
* @param error Error, if any
* @param [response] StreamingRecognizeResponse
*/
type StreamingRecognizeCallback = (error: (Error|null), response?: google.cloud.speech.v1.StreamingRecognizeResponse) => void;
}
/** Properties of a RecognizeRequest. */
interface IRecognizeRequest {
/** RecognizeRequest config */
config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** RecognizeRequest audio */
audio?: (google.cloud.speech.v1.IRecognitionAudio|null);
}
/** Represents a RecognizeRequest. */
class RecognizeRequest implements IRecognizeRequest {
/**
* Constructs a new RecognizeRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.IRecognizeRequest);
/** RecognizeRequest config. */
public config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** RecognizeRequest audio. */
public audio?: (google.cloud.speech.v1.IRecognitionAudio|null);
/**
* Creates a new RecognizeRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns RecognizeRequest instance
*/
public static create(properties?: google.cloud.speech.v1.IRecognizeRequest): google.cloud.speech.v1.RecognizeRequest;
/**
* Encodes the specified RecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages.
* @param message RecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified RecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.RecognizeRequest.verify|verify} messages.
* @param message RecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.IRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a RecognizeRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns RecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.RecognizeRequest;
/**
* Decodes a RecognizeRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns RecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.RecognizeRequest;
/**
* Verifies a RecognizeRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a RecognizeRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns RecognizeRequest
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.RecognizeRequest;
/**
* Creates a plain object from a RecognizeRequest message. Also converts values to other types if specified.
* @param message RecognizeRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.RecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this RecognizeRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for RecognizeRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a LongRunningRecognizeRequest. */
interface ILongRunningRecognizeRequest {
/** LongRunningRecognizeRequest config */
config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** LongRunningRecognizeRequest audio */
audio?: (google.cloud.speech.v1.IRecognitionAudio|null);
/** LongRunningRecognizeRequest outputConfig */
outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null);
}
/** Represents a LongRunningRecognizeRequest. */
class LongRunningRecognizeRequest implements ILongRunningRecognizeRequest {
/**
* Constructs a new LongRunningRecognizeRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest);
/** LongRunningRecognizeRequest config. */
public config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** LongRunningRecognizeRequest audio. */
public audio?: (google.cloud.speech.v1.IRecognitionAudio|null);
/** LongRunningRecognizeRequest outputConfig. */
public outputConfig?: (google.cloud.speech.v1.ITranscriptOutputConfig|null);
/**
* Creates a new LongRunningRecognizeRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns LongRunningRecognizeRequest instance
*/
public static create(properties?: google.cloud.speech.v1.ILongRunningRecognizeRequest): google.cloud.speech.v1.LongRunningRecognizeRequest;
/**
* Encodes the specified LongRunningRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
* @param message LongRunningRecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified LongRunningRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.LongRunningRecognizeRequest.verify|verify} messages.
* @param message LongRunningRecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.ILongRunningRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a LongRunningRecognizeRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns LongRunningRecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.LongRunningRecognizeRequest;
/**
* Decodes a LongRunningRecognizeRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns LongRunningRecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.LongRunningRecognizeRequest;
/**
* Verifies a LongRunningRecognizeRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a LongRunningRecognizeRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns LongRunningRecognizeRequest
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.LongRunningRecognizeRequest;
/**
* Creates a plain object from a LongRunningRecognizeRequest message. Also converts values to other types if specified.
* @param message LongRunningRecognizeRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.LongRunningRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this LongRunningRecognizeRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for LongRunningRecognizeRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a TranscriptOutputConfig. */
interface ITranscriptOutputConfig {
/** TranscriptOutputConfig gcsUri */
gcsUri?: (string|null);
}
/** Represents a TranscriptOutputConfig. */
class TranscriptOutputConfig implements ITranscriptOutputConfig {
/**
* Constructs a new TranscriptOutputConfig.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.ITranscriptOutputConfig);
/** TranscriptOutputConfig gcsUri. */
public gcsUri?: (string|null);
/** TranscriptOutputConfig outputType. */
public outputType?: "gcsUri";
/**
* Creates a new TranscriptOutputConfig instance using the specified properties.
* @param [properties] Properties to set
* @returns TranscriptOutputConfig instance
*/
public static create(properties?: google.cloud.speech.v1.ITranscriptOutputConfig): google.cloud.speech.v1.TranscriptOutputConfig;
/**
* Encodes the specified TranscriptOutputConfig message. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages.
* @param message TranscriptOutputConfig message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified TranscriptOutputConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.TranscriptOutputConfig.verify|verify} messages.
* @param message TranscriptOutputConfig message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.ITranscriptOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a TranscriptOutputConfig message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns TranscriptOutputConfig
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.TranscriptOutputConfig;
/**
* Decodes a TranscriptOutputConfig message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns TranscriptOutputConfig
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.TranscriptOutputConfig;
/**
* Verifies a TranscriptOutputConfig message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a TranscriptOutputConfig message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns TranscriptOutputConfig
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.TranscriptOutputConfig;
/**
* Creates a plain object from a TranscriptOutputConfig message. Also converts values to other types if specified.
* @param message TranscriptOutputConfig
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.TranscriptOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this TranscriptOutputConfig to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for TranscriptOutputConfig
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a StreamingRecognizeRequest. */
interface IStreamingRecognizeRequest {
/** StreamingRecognizeRequest streamingConfig */
streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null);
/** StreamingRecognizeRequest audioContent */
audioContent?: (Uint8Array|Buffer|string|null);
}
/** Represents a StreamingRecognizeRequest. */
class StreamingRecognizeRequest implements IStreamingRecognizeRequest {
/**
* Constructs a new StreamingRecognizeRequest.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest);
/** StreamingRecognizeRequest streamingConfig. */
public streamingConfig?: (google.cloud.speech.v1.IStreamingRecognitionConfig|null);
/** StreamingRecognizeRequest audioContent. */
public audioContent?: (Uint8Array|Buffer|string|null);
/** StreamingRecognizeRequest streamingRequest. */
public streamingRequest?: ("streamingConfig"|"audioContent");
/**
* Creates a new StreamingRecognizeRequest instance using the specified properties.
* @param [properties] Properties to set
* @returns StreamingRecognizeRequest instance
*/
public static create(properties?: google.cloud.speech.v1.IStreamingRecognizeRequest): google.cloud.speech.v1.StreamingRecognizeRequest;
/**
* Encodes the specified StreamingRecognizeRequest message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
* @param message StreamingRecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified StreamingRecognizeRequest message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognizeRequest.verify|verify} messages.
* @param message StreamingRecognizeRequest message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognizeRequest, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a StreamingRecognizeRequest message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns StreamingRecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognizeRequest;
/**
* Decodes a StreamingRecognizeRequest message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns StreamingRecognizeRequest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognizeRequest;
/**
* Verifies a StreamingRecognizeRequest message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a StreamingRecognizeRequest message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns StreamingRecognizeRequest
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognizeRequest;
/**
* Creates a plain object from a StreamingRecognizeRequest message. Also converts values to other types if specified.
* @param message StreamingRecognizeRequest
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.StreamingRecognizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this StreamingRecognizeRequest to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for StreamingRecognizeRequest
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
/** Properties of a StreamingRecognitionConfig. */
interface IStreamingRecognitionConfig {
/** StreamingRecognitionConfig config */
config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** StreamingRecognitionConfig singleUtterance */
singleUtterance?: (boolean|null);
/** StreamingRecognitionConfig interimResults */
interimResults?: (boolean|null);
/** StreamingRecognitionConfig enableVoiceActivityEvents */
enableVoiceActivityEvents?: (boolean|null);
/** StreamingRecognitionConfig voiceActivityTimeout */
voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null);
}
/** Represents a StreamingRecognitionConfig. */
class StreamingRecognitionConfig implements IStreamingRecognitionConfig {
/**
* Constructs a new StreamingRecognitionConfig.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig);
/** StreamingRecognitionConfig config. */
public config?: (google.cloud.speech.v1.IRecognitionConfig|null);
/** StreamingRecognitionConfig singleUtterance. */
public singleUtterance: boolean;
/** StreamingRecognitionConfig interimResults. */
public interimResults: boolean;
/** StreamingRecognitionConfig enableVoiceActivityEvents. */
public enableVoiceActivityEvents: boolean;
/** StreamingRecognitionConfig voiceActivityTimeout. */
public voiceActivityTimeout?: (google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout|null);
/**
* Creates a new StreamingRecognitionConfig instance using the specified properties.
* @param [properties] Properties to set
* @returns StreamingRecognitionConfig instance
*/
public static create(properties?: google.cloud.speech.v1.IStreamingRecognitionConfig): google.cloud.speech.v1.StreamingRecognitionConfig;
/**
* Encodes the specified StreamingRecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
* @param message StreamingRecognitionConfig message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified StreamingRecognitionConfig message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.verify|verify} messages.
* @param message StreamingRecognitionConfig message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.IStreamingRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a StreamingRecognitionConfig message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns StreamingRecognitionConfig
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig;
/**
* Decodes a StreamingRecognitionConfig message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns StreamingRecognitionConfig
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig;
/**
* Verifies a StreamingRecognitionConfig message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a StreamingRecognitionConfig message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns StreamingRecognitionConfig
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig;
/**
* Creates a plain object from a StreamingRecognitionConfig message. Also converts values to other types if specified.
* @param message StreamingRecognitionConfig
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this StreamingRecognitionConfig to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for StreamingRecognitionConfig
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
namespace StreamingRecognitionConfig {
/** Properties of a VoiceActivityTimeout. */
interface IVoiceActivityTimeout {
/** VoiceActivityTimeout speechStartTimeout */
speechStartTimeout?: (google.protobuf.IDuration|null);
/** VoiceActivityTimeout speechEndTimeout */
speechEndTimeout?: (google.protobuf.IDuration|null);
}
/** Represents a VoiceActivityTimeout. */
class VoiceActivityTimeout implements IVoiceActivityTimeout {
/**
* Constructs a new VoiceActivityTimeout.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout);
/** VoiceActivityTimeout speechStartTimeout. */
public speechStartTimeout?: (google.protobuf.IDuration|null);
/** VoiceActivityTimeout speechEndTimeout. */
public speechEndTimeout?: (google.protobuf.IDuration|null);
/**
* Creates a new VoiceActivityTimeout instance using the specified properties.
* @param [properties] Properties to set
* @returns VoiceActivityTimeout instance
*/
public static create(properties?: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout;
/**
* Encodes the specified VoiceActivityTimeout message. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages.
* @param message VoiceActivityTimeout message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified VoiceActivityTimeout message, length delimited. Does not implicitly {@link google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout.verify|verify} messages.
* @param message VoiceActivityTimeout message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: google.cloud.speech.v1.StreamingRecognitionConfig.IVoiceActivityTimeout, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a VoiceActivityTimeout message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns VoiceActivityTimeout
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout;
/**
* Decodes a VoiceActivityTimeout message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns VoiceActivityTimeout
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout;
/**
* Verifies a VoiceActivityTimeout message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a VoiceActivityTimeout message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns VoiceActivityTimeout
*/
public static fromObject(object: { [k: string]: any }): google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout;
/**
* Creates a plain object from a VoiceActivityTimeout message. Also converts values to other types if specified.
* @param message VoiceActivityTimeout
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: google.cloud.speech.v1.StreamingRecognitionConfig.VoiceActivityTimeout, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this VoiceActivityTimeout to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
/**
* Gets the default type url for VoiceActivityTimeout
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns The default type url
*/
public static getTypeUrl(typeUrlPrefix?: string): string;
}
}
/** Properties of a RecognitionConfig. */
interface IRecognitionConfig {
/** RecognitionConfig encoding */
encoding?: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding|null);
/** RecognitionConfig sampleRateHertz */
sampleRateHertz?: (number|null);
/** RecognitionConfig audioChannelCount */
audioChannelCount?: (number|null);
/** RecognitionConfig enableSeparateRecognitionPerChannel */
enableSeparateRecognitionPerChannel?: (boolean|null);
/** RecognitionConfig languageCode */
languageCode?: (string|null);
/** RecognitionConfig alternativeLanguageCodes */
alternativeLanguageCodes?: (string[]|null);
/** RecognitionConfig maxAlternatives */
maxAlternatives?: (number|null);
/** RecognitionConfig profanityFilter */
profanityFilter?: (boolean|null);
/** RecognitionConfig adaptation */
adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null);
/** RecognitionConfig transcriptNormalization */
transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null);
/** RecognitionConfig speechContexts */
speechContexts?: (google.cloud.speech.v1.ISpeechContext[]|null);
/** RecognitionConfig enableWordTimeOffsets */
enableWordTimeOffsets?: (boolean|null);
/** RecognitionConfig enableWordConfidence */
enableWordConfidence?: (boolean|null);
/** RecognitionConfig enableAutomaticPunctuation */
enableAutomaticPunctuation?: (boolean|null);
/** RecognitionConfig enableSpokenPunctuation */
enableSpokenPunctuation?: (google.protobuf.IBoolValue|null);
/** RecognitionConfig enableSpokenEmojis */
enableSpokenEmojis?: (google.protobuf.IBoolValue|null);
/** RecognitionConfig diarizationConfig */
diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null);
/** RecognitionConfig metadata */
metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null);
/** RecognitionConfig model */
model?: (string|null);
/** RecognitionConfig useEnhanced */
useEnhanced?: (boolean|null);
}
/** Represents a RecognitionConfig. */
class RecognitionConfig implements IRecognitionConfig {
/**
* Constructs a new RecognitionConfig.
* @param [properties] Properties to set
*/
constructor(properties?: google.cloud.speech.v1.IRecognitionConfig);
/** RecognitionConfig encoding. */
public encoding: (google.cloud.speech.v1.RecognitionConfig.AudioEncoding|keyof typeof google.cloud.speech.v1.RecognitionConfig.AudioEncoding);
/** RecognitionConfig sampleRateHertz. */
public sampleRateHertz: number;
/** RecognitionConfig audioChannelCount. */
public audioChannelCount: number;
/** RecognitionConfig enableSeparateRecognitionPerChannel. */
public enableSeparateRecognitionPerChannel: boolean;
/** RecognitionConfig languageCode. */
public languageCode: string;
/** RecognitionConfig alternativeLanguageCodes. */
public alternativeLanguageCodes: string[];
/** RecognitionConfig maxAlternatives. */
public maxAlternatives: number;
/** RecognitionConfig profanityFilter. */
public profanityFilter: boolean;
/** RecognitionConfig adaptation. */
public adaptation?: (google.cloud.speech.v1.ISpeechAdaptation|null);
/** RecognitionConfig transcriptNormalization. */
public transcriptNormalization?: (google.cloud.speech.v1.ITranscriptNormalization|null);
/** RecognitionConfig speechContexts. */
public speechContexts: google.cloud.speech.v1.ISpeechContext[];
/** RecognitionConfig enableWordTimeOffsets. */
public enableWordTimeOffsets: boolean;
/** RecognitionConfig enableWordConfidence. */
public enableWordConfidence: boolean;
/** RecognitionConfig enableAutomaticPunctuation. */
public enableAutomaticPunctuation: boolean;
/** RecognitionConfig enableSpokenPunctuation. */
public enableSpokenPunctuation?: (google.protobuf.IBoolValue|null);
/** RecognitionConfig enableSpokenEmojis. */
public enableSpokenEmojis?: (google.protobuf.IBoolValue|null);
/** RecognitionConfig diarizationConfig. */
public diarizationConfig?: (google.cloud.speech.v1.ISpeakerDiarizationConfig|null);
/** RecognitionConfig metadata. */
public metadata?: (google.cloud.speech.v1.IRecognitionMetadata|null);
/** RecognitionConfig model. */
public model: string;
/** RecognitionConfig useEnhanced. */
public useEnhanced: boolean;
/**
* Creates a new RecognitionConfig instance using the specified properties.
* @param [properties] Properties to set
* @returns RecognitionConfig instance
*/
public static create(properties?: google.cloud.speech.v1.IRecognitionConfig): google.cloud.speech.v1.RecognitionConfig;
/**
* Encodes the specified RecognitionConfig message. Does not implicitly {@link google.cloud.speech.v1.RecognitionConfig.verify|verify} messages.
* @param message RecognitionConfig message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: google.cloud.speech.v1.IRecognitionConfig, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified RecognitionConf