SpeechMarkdown v0.2.1 SpeechMarkdown

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.

Link to this section Summary

Functions

Convert the given Speech Markdown into plain text.

Convert the given Speech Markdown into SSML.

Link to this section Types

Link to this type

option()

option() ::
  {:xml_declaration, boolean()}
  | {:variant, :general | :google | :alexa}
  | {:validate, :strict | :loose}
Link to this type

options()

options() :: [option()]

Link to this section Functions

Link to this function

to_plaintext(input)

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)

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

to_ssml(input, options \\ [])

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 \\ [])

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