View Source ExAzureSpeech.SpeechToText.SocketConfig (ex_azure_speech v0.1.1)

Configurations required to establish a WebSocket connection with the Azure Cognitive Speech Service.

Summary

Types

t()
  • :connection_id (String.t/0) - Required. A unique identifier for the connection. This is used to correlate the recognition results with the requests.

Functions

Returns the URI to establish a WebSocket connection with the Azure Cognitive Services Speech Service.

Returns a validated basic configuration for the Azure Cognitive Services Speech Pronunciation Accessment.

Types

@type t() :: [
  connection_id: binary(),
  auth_key: binary(),
  region: binary(),
  format: term(),
  language: binary(),
  recognition_mode: term()
]
  • :connection_id (String.t/0) - Required. A unique identifier for the connection. This is used to correlate the recognition results with the requests.

  • :auth_key (String.t/0) - Required. The subscription key for the Azure Cognitive Services Speech Service.

  • :region (String.t/0) - Required. The region where the Azure Cognitive Services Speech Service is hosted. This is used to determine the base URL for the WebSocket connection.

  • :format - The format of the recognition results. :simple returns only the recognition result, while :detailed returns the recognition result along with the detailed pronunciation assessment. The default value is :simple.

  • :language (String.t/0) - Required. The language of the speech to be recognized. This is used to determine the language model to be used for recognition. E.g., 'en-US', 'fr-FR', etc.

  • :recognition_mode - The recognition mode to be used. :interactive is optimized for short phrases, :conversation is optimized for conversational speech, and :dictation is optimized for long-form speech. The default value is :interactive.

Example Configuration

[
  region: "westus",
  auth_key: "your_subscription_key",
  language: "en-US",
  format: :simple,
  recognition_mode: :interactive
]

Default global values can be set in the application configuration.

config :ex_azure_speech,
  region: "westus",
  auth_key: "your_subscription_key",
  language: "en-US",
  pronunciation_assessment: [
    format: :simple,
    recognition_mode: :interactive
  ]

Functions

@spec get_uri(t()) :: String.t()

Returns the URI to establish a WebSocket connection with the Azure Cognitive Services Speech Service.

@spec new(Keyword.t()) :: {:ok, t()} | {:error, NimbleOptions.ValidationError.t()}

Returns a validated basic configuration for the Azure Cognitive Services Speech Pronunciation Accessment.