MRCPSynth()

MRCPSynth() is a dialplan application provided by the res_unimrcp.so module (see Developing Speech Applications on Asterisk for more information) that performs text-to-speech (TTS) synthesis of plaintext or SSML-formatted documents.

Application 

MRCPSynth(text,options)

Parameters

text

Text for the TTS to read to the caller. Valid options are plaintext specified inline, SSML specified inline, or a path/URI to an SSML document. See our SSML developer's guide for more information about working with SSML.

options

Options control details about the synthesis. Valid options are:

  • l - language to use (e.g. "en-GB", "en-US", "en-AU", etc.)
  • v - voice name to use (e.g. "Lindsey", "Chris", etc.)
  • g - voice gender to use (e.g. "male", "female")
  • p - profile to use, as specified in the mrcp.conf file
  • i - digits to allow the TTS to be interrupted with (can specify "any" to allow any digits to interrupt)
  • f - filename on disk to store audio to (audio not stored if not specified or empty)
  • epe – exit on a play error
  • pv - prosody volume (silent/x-soft/soft/medium/load/x-loud/default)
  • pr - prosody rate (x-slow/slow/medium/fast/x-fast/default)

You are not required to supply any options. Multiple options can be provided by joining options with an ampersand, e.g. l=en-US&g=female

Remarks

Because dialplan applications cannot take more than 1024 characters as arguments, any long text to be synthesized should be specified as an SSML document via external reference (see below for examples). You are limited to about 10 seconds of synthesized text with any MRCPSynth() call.

If you supply SSML inline, be sure and escape all quotation makes and commas with backslashes.

Parameters such as language or voice specified in an SSML document will take precedence over any options set when invoking the MRCPSynth() application. Our recommendation is to use SSML for this kind of control.

Example Uses

Hello World (plain text)

exten => 1,1,MRCPSynth(Hello world)

Set Language via Option

exten => 1,1,MRCPSynth(Bonjour monde,l=fr-FR)

Multiple Options

exten => 1,1,MRCPSynth(Bonjour monde,l=fr-FR&i=any)

SSML Referenced via HTTP

exten => 1,1,MRCPSynth(http://mySSMLServer/ssml/helloworld.ssml)

Inline SSML

exten => 1,1,MRCPSynth(<?xml version=\"1.0\"?><speak version=\"1.0\"><voice name=\"Lindsey\">My name is Lindsey.</voice><voice name=\"Chris\">And I'm Chris</voice><voice xml:lang=\"en-GB\">And I'm British</voice></speak>,p=default)



Was this article helpful?
Copyright (C) 2001-2024, Ai Software, LLC d/b/a LumenVox