VoiceEngine.TTS behaviour (voice_engine v0.1.0)

Copy Markdown View Source

Behaviour for text-to-speech adapters.

Both buffered (synthesize/2) and streaming (stream_synthesize/2) are required. The Bridge uses streaming for real-time playback.

Summary

Types

audio_blob()

@type audio_blob() :: binary()

Callbacks

stream_synthesize(text, opts)

@callback stream_synthesize(text :: String.t(), opts :: keyword()) ::
  {:ok, Enumerable.t()} | {:error, term()}

synthesize(text, opts)

@callback synthesize(text :: String.t(), opts :: keyword()) ::
  {:ok, audio_blob()} | {:error, term()}