Class RecognizeWithWebsocketsOptions.Builder

java.lang.Object
com.ibm.watson.speech_to_text.v1.model.RecognizeWithWebsocketsOptions.Builder
Enclosing class:
RecognizeWithWebsocketsOptions

public static class RecognizeWithWebsocketsOptions.Builder
extends Object
Builder.
  • Constructor Details

    • Builder

      public Builder()
      Instantiates a new builder.
    • Builder

      public Builder​(InputStream audio)
      Instantiates a new builder with required properties.
      Parameters:
      audio - the audio
  • Method Details

    • build

      Builds a RecognizeOptions.
      Returns:
      the new RecognizeOptions instance
    • addKeyword

      public RecognizeWithWebsocketsOptions.Builder addKeyword​(String keyword)
      Adds an keyword to keywords.
      Parameters:
      keyword - the new keyword
      Returns:
      the RecognizeOptions builder
    • audio

      Set the audio.
      Parameters:
      audio - the audio
      Returns:
      the RecognizeOptions builder
    • contentType

      public RecognizeWithWebsocketsOptions.Builder contentType​(String contentType)
      Set the contentType.
      Parameters:
      contentType - the contentType
      Returns:
      the RecognizeOptions builder
    • model

      Set the model.
      Parameters:
      model - the model
      Returns:
      the RecognizeOptions builder
    • languageCustomizationId

      public RecognizeWithWebsocketsOptions.Builder languageCustomizationId​(String languageCustomizationId)
      Set the languageCustomizationId.
      Parameters:
      languageCustomizationId - the languageCustomizationId
      Returns:
      the RecognizeOptions builder
    • acousticCustomizationId

      public RecognizeWithWebsocketsOptions.Builder acousticCustomizationId​(String acousticCustomizationId)
      Set the acousticCustomizationId.
      Parameters:
      acousticCustomizationId - the acousticCustomizationId
      Returns:
      the RecognizeOptions builder
    • baseModelVersion

      public RecognizeWithWebsocketsOptions.Builder baseModelVersion​(String baseModelVersion)
      Set the baseModelVersion.
      Parameters:
      baseModelVersion - the baseModelVersion
      Returns:
      the RecognizeOptions builder
    • customizationWeight

      public RecognizeWithWebsocketsOptions.Builder customizationWeight​(Double customizationWeight)
      Set the customizationWeight.
      Parameters:
      customizationWeight - the customizationWeight
      Returns:
      the RecognizeOptions builder
    • inactivityTimeout

      public RecognizeWithWebsocketsOptions.Builder inactivityTimeout​(long inactivityTimeout)
      Set the inactivityTimeout.
      Parameters:
      inactivityTimeout - the inactivityTimeout
      Returns:
      the RecognizeOptions builder
    • keywords

      public RecognizeWithWebsocketsOptions.Builder keywords​(List<String> keywords)
      Set the keywords. Existing keywords will be replaced.
      Parameters:
      keywords - the keywords
      Returns:
      the RecognizeOptions builder
    • keywordsThreshold

      public RecognizeWithWebsocketsOptions.Builder keywordsThreshold​(Float keywordsThreshold)
      Set the keywordsThreshold.
      Parameters:
      keywordsThreshold - the keywordsThreshold
      Returns:
      the RecognizeOptions builder
    • maxAlternatives

      public RecognizeWithWebsocketsOptions.Builder maxAlternatives​(long maxAlternatives)
      Set the maxAlternatives.
      Parameters:
      maxAlternatives - the maxAlternatives
      Returns:
      the RecognizeOptions builder
    • wordAlternativesThreshold

      public RecognizeWithWebsocketsOptions.Builder wordAlternativesThreshold​(Float wordAlternativesThreshold)
      Set the wordAlternativesThreshold.
      Parameters:
      wordAlternativesThreshold - the wordAlternativesThreshold
      Returns:
      the RecognizeOptions builder
    • wordConfidence

      public RecognizeWithWebsocketsOptions.Builder wordConfidence​(Boolean wordConfidence)
      Set the wordConfidence.
      Parameters:
      wordConfidence - the wordConfidence
      Returns:
      the RecognizeOptions builder
    • timestamps

      public RecognizeWithWebsocketsOptions.Builder timestamps​(Boolean timestamps)
      Set the timestamps.
      Parameters:
      timestamps - the timestamps
      Returns:
      the RecognizeOptions builder
    • profanityFilter

      public RecognizeWithWebsocketsOptions.Builder profanityFilter​(Boolean profanityFilter)
      Set the profanityFilter.
      Parameters:
      profanityFilter - the profanityFilter
      Returns:
      the RecognizeOptions builder
    • smartFormatting

      public RecognizeWithWebsocketsOptions.Builder smartFormatting​(Boolean smartFormatting)
      Set the smartFormatting.
      Parameters:
      smartFormatting - the smartFormatting
      Returns:
      the RecognizeOptions builder
    • speakerLabels

      public RecognizeWithWebsocketsOptions.Builder speakerLabels​(Boolean speakerLabels)
      Set the speakerLabels.
      Parameters:
      speakerLabels - the speakerLabels
      Returns:
      the RecognizeOptions builder
    • customizationId

      public RecognizeWithWebsocketsOptions.Builder customizationId​(String customizationId)
      Set the customizationId.
      Parameters:
      customizationId - the customizationId
      Returns:
      the RecognizeOptions builder
    • grammarName

      public RecognizeWithWebsocketsOptions.Builder grammarName​(String grammarName)
      Set the grammarName.
      Parameters:
      grammarName - the grammarName
      Returns:
      the RecognizeOptions builder
    • redaction

      public RecognizeWithWebsocketsOptions.Builder redaction​(Boolean redaction)
      Set the redaction.
      Parameters:
      redaction - the redaction
      Returns:
      the RecognizeOptions builder
    • audioMetrics

      public RecognizeWithWebsocketsOptions.Builder audioMetrics​(Boolean audioMetrics)
      Set the audioMetrics.
      Parameters:
      audioMetrics - the audioMetrics
      Returns:
      the RecognizeOptions builder
    • endOfPhraseSilenceTime

      public RecognizeWithWebsocketsOptions.Builder endOfPhraseSilenceTime​(Double endOfPhraseSilenceTime)
      Set the endOfPhraseSilenceTime.
      Parameters:
      endOfPhraseSilenceTime - the endOfPhraseSilenceTime
      Returns:
      the RecognizeOptions builder
    • splitTranscriptAtPhraseEnd

      public RecognizeWithWebsocketsOptions.Builder splitTranscriptAtPhraseEnd​(Boolean splitTranscriptAtPhraseEnd)
      Set the splitTranscriptAtPhraseEnd.
      Parameters:
      splitTranscriptAtPhraseEnd - the splitTranscriptAtPhraseEnd
      Returns:
      the RecognizeOptions builder
    • speechDetectorSensitivity

      public RecognizeWithWebsocketsOptions.Builder speechDetectorSensitivity​(Float speechDetectorSensitivity)
      Set the speechDetectorSensitivity.
      Parameters:
      speechDetectorSensitivity - the speechDetectorSensitivity
      Returns:
      the RecognizeOptions builder
    • backgroundAudioSuppression

      public RecognizeWithWebsocketsOptions.Builder backgroundAudioSuppression​(Float backgroundAudioSuppression)
      Set the backgroundAudioSuppression.
      Parameters:
      backgroundAudioSuppression - the backgroundAudioSuppression
      Returns:
      the RecognizeOptions builder
    • audio

      Set the audio.
      Parameters:
      audio - the audio
      Returns:
      the RecognizeOptions builder
      Throws:
      FileNotFoundException - if the file could not be found
    • interimResults

      public RecognizeWithWebsocketsOptions.Builder interimResults​(Boolean interimResults)
      Set the interimResults.

      NOTE: This parameter only works for the `recognizeUsingWebSocket` method.

      Parameters:
      interimResults - the interimResults
      Returns:
      the interimResults
    • processingMetrics

      public RecognizeWithWebsocketsOptions.Builder processingMetrics​(Boolean processingMetrics)
      Set the processingMetrics.

      NOTE: This parameter only works for the `recognizeUsingWebSocket` method.

      Parameters:
      processingMetrics - the processingMetrics
      Returns:
      the processingMetrics
    • processingMetricsInterval

      public RecognizeWithWebsocketsOptions.Builder processingMetricsInterval​(Float processingMetricsInterval)
      Set the processingMetricsInterval.

      NOTE: This parameter only works for the `recognizeUsingWebSocket` method.

      Parameters:
      processingMetricsInterval - the processingMetricsInterval
      Returns:
      the processingMetricsInterval