View Source ExAzureSpeech.SpeechToText behaviour (ex_azure_speech v0.2.0)

Speech-to-Text module, which provides the functionality to recognize speech from audio input.

Supported Formats

Right now the recognition service supports only RIFF WAV (WAVE) audio format. The audio must be mono, with a sample rate of 16 kHz and 16-bit PCM encoding.

Summary

Types

See the SocketConfig.t() and SpeechContextConfig.t() module for more information on the available options.

Callbacks

Recognizes speech from the given audio input continuously. It imediately returns a stream that can be lazily consumed.

Synchronously recognizes speech from the given audio input.

Types

@type opts() :: [
  socket_opts: ExAzureSpeech.SpeechToText.SocketConfig.t() | nil,
  speech_context_opts: ExAzureSpeech.SpeechToText.SpeechContextConfig.t() | nil,
  timeout: integer() | nil
]

See the SocketConfig.t() and SpeechContextConfig.t() module for more information on the available options.

Callbacks

Link to this callback

recognize_continous(audio_stream, recognition_options)

View Source
@callback recognize_continous(
  audio_stream :: Enumerable.t(),
  recognition_options :: opts()
) ::
  {:ok, Enumerable.t()}
  | {:error,
     ExAzureSpeech.Common.Errors.Internal.t()
     | ExAzureSpeech.Common.Errors.InvalidResponse.t()
     | ExAzureSpeech.Common.Errors.Forbidden.t()
     | NimbleOptions.ValidationError.t()}

Recognizes speech from the given audio input continuously. It imediately returns a stream that can be lazily consumed.

Link to this callback

recognize_once(audio_stream, recognition_options)

View Source

Synchronously recognizes speech from the given audio input.