SpeechMarkdown (SpeechMarkdown v0.5.1)

Elixir implementation for the Speech Markdown format.

https://www.speechmarkdown.org/

Speech Markdown is a text format which is akin to regular Markdown, but with an alternative syntax and built for the purpose of generating platform-specific SSML markup.

The Speech Markdown transpiler converts the given Speeach Markdown text to the Speech Synthesis Markup Language (SSML) format. The results are returned as an SSML string.

Currently, SMD → SSML support is available in a general variant, and specific SSML variants for the Amazon Alexa and Google Assistant platforms.

Summary

Functions

Convert the given Speech Markdown into plain text.

Convert the given Speech Markdown into SSML.

Types

@type option() ::
  {:xml_declaration, boolean()}
  | {:variant, :general | :google | :alexa}
  | {:validate, :strict | :loose}
@type options() :: [option()]

Functions

Link to this function

to_plaintext(input)

@spec to_plaintext(input :: String.t()) ::
  ssml :: {:ok, String.t()} | {:error, term()}

Convert the given Speech Markdown into plain text.

Link to this function

to_plaintext!(input)

@spec to_plaintext!(input :: String.t()) :: ssml :: String.t()
Link to this function

to_ssml(input, options \\ [])

@spec to_ssml(input :: String.t(), options()) :: {:ok, String.t()} | {:error, term()}

Convert the given Speech Markdown into SSML.

Options:

  • xml_declaration - boolean to indicate whether we need the XML declaration in the output, default false

  • variant - Which SSML variant to choose from. Either :general, :alexa or :google; defaults to :general.

  • validate - :strict (default) or :loose; when strict, return error when encountering invalid syntax, unknown attributes or unknown attribute values; when :loose, such errors are ignored.

Link to this function

to_ssml!(input, options \\ [])

@spec to_ssml!(input :: String.t(), options()) :: String.t()