RecognitionConfig constructor
RecognitionConfig({
- RecognitionConfig_AudioEncoding? encoding,
- int? sampleRateHertz,
- String? languageCode,
- int? maxAlternatives,
- bool? profanityFilter,
- Iterable<
SpeechContext> ? speechContexts, - int? audioChannelCount,
- bool? enableWordTimeOffsets,
- RecognitionMetadata? metadata,
- bool? enableAutomaticPunctuation,
- bool? enableSeparateRecognitionPerChannel,
- String? model,
- bool? useEnhanced,
- bool? enableWordConfidence,
- @Deprecated('This field is deprecated.') bool? enableSpeakerDiarization,
- @Deprecated('This field is deprecated.') int? diarizationSpeakerCount,
- Iterable<
String> ? alternativeLanguageCodes, - SpeakerDiarizationConfig? diarizationConfig,
- SpeechAdaptation? adaptation,
- BoolValue? enableSpokenPunctuation,
- BoolValue? enableSpokenEmojis,
- TranscriptNormalization? transcriptNormalization,
Implementation
factory RecognitionConfig({
RecognitionConfig_AudioEncoding? encoding,
$core.int? sampleRateHertz,
$core.String? languageCode,
$core.int? maxAlternatives,
$core.bool? profanityFilter,
$core.Iterable<SpeechContext>? speechContexts,
$core.int? audioChannelCount,
$core.bool? enableWordTimeOffsets,
RecognitionMetadata? metadata,
$core.bool? enableAutomaticPunctuation,
$core.bool? enableSeparateRecognitionPerChannel,
$core.String? model,
$core.bool? useEnhanced,
$core.bool? enableWordConfidence,
@$core.Deprecated('This field is deprecated.')
$core.bool? enableSpeakerDiarization,
@$core.Deprecated('This field is deprecated.')
$core.int? diarizationSpeakerCount,
$core.Iterable<$core.String>? alternativeLanguageCodes,
SpeakerDiarizationConfig? diarizationConfig,
$4.SpeechAdaptation? adaptation,
$5.BoolValue? enableSpokenPunctuation,
$5.BoolValue? enableSpokenEmojis,
$4.TranscriptNormalization? transcriptNormalization,
}) {
final $result = create();
if (encoding != null) {
$result.encoding = encoding;
}
if (sampleRateHertz != null) {
$result.sampleRateHertz = sampleRateHertz;
}
if (languageCode != null) {
$result.languageCode = languageCode;
}
if (maxAlternatives != null) {
$result.maxAlternatives = maxAlternatives;
}
if (profanityFilter != null) {
$result.profanityFilter = profanityFilter;
}
if (speechContexts != null) {
$result.speechContexts.addAll(speechContexts);
}
if (audioChannelCount != null) {
$result.audioChannelCount = audioChannelCount;
}
if (enableWordTimeOffsets != null) {
$result.enableWordTimeOffsets = enableWordTimeOffsets;
}
if (metadata != null) {
$result.metadata = metadata;
}
if (enableAutomaticPunctuation != null) {
$result.enableAutomaticPunctuation = enableAutomaticPunctuation;
}
if (enableSeparateRecognitionPerChannel != null) {
$result.enableSeparateRecognitionPerChannel =
enableSeparateRecognitionPerChannel;
}
if (model != null) {
$result.model = model;
}
if (useEnhanced != null) {
$result.useEnhanced = useEnhanced;
}
if (enableWordConfidence != null) {
$result.enableWordConfidence = enableWordConfidence;
}
if (enableSpeakerDiarization != null) {
// ignore: deprecated_member_use_from_same_package
$result.enableSpeakerDiarization = enableSpeakerDiarization;
}
if (diarizationSpeakerCount != null) {
// ignore: deprecated_member_use_from_same_package
$result.diarizationSpeakerCount = diarizationSpeakerCount;
}
if (alternativeLanguageCodes != null) {
$result.alternativeLanguageCodes.addAll(alternativeLanguageCodes);
}
if (diarizationConfig != null) {
$result.diarizationConfig = diarizationConfig;
}
if (adaptation != null) {
$result.adaptation = adaptation;
}
if (enableSpokenPunctuation != null) {
$result.enableSpokenPunctuation = enableSpokenPunctuation;
}
if (enableSpokenEmojis != null) {
$result.enableSpokenEmojis = enableSpokenEmojis;
}
if (transcriptNormalization != null) {
$result.transcriptNormalization = transcriptNormalization;
}
return $result;
}