i18n support of playing audio files and numbers on Asterisk.

28 views
Skip to first unread message

Steve Sether

unread,
Apr 24, 2018, 2:05:16 PM4/24/18
to Adhearsion
I'm using the i18n plugin for Adhearsion, but I don't need full text to speech, only playing audio files and saying numbers.  We've setup swift and configured adhearsion to use it. Since we don't need TTS and will rely on pre-recorded audio, we'd like to save some licensing costs and use Festival (or some other solution).  I've tried installing Festival on Asterisk, and confirmed that it's working.  However, when I configure Adhearsion to use Asterisk as the default renderer (config.platform.media.default_renderer = :asterisk) I get an error about an unrenderable document:

ERROR Adhearsion::Call: 5845c305-2386-4183-9470-d492cf94c687@: <Punchblock::ProtocolError> #<Punchblock::ProtocolError: name="unrenderable document error" text="The provided document could not be rendered. See http://adhearsion.com/docs/common_problems#unrenderable-document-error for details." call_id=nil component_id=nil>

The link suggests that Asterisk needs a TTS tool installed, and I know Festival works perfectly fine since I tested it with a simple dialplan entry that calls Festival. It looks like i18n is producing some SSM, which I'm guessing isn't being interpreted by...  something.  Asterisk?  AFAIK Festival doesn't support SSML.

So is there a way to configure Adhearsion and Asterisk so it'll do what I want?  Stated shortly, I just want Adhearsion-i18n to play a file, then say a number, then play another file.  In other words, the TTS piece is limited to just numbers.  I know I can do this without i18n, but is there another way to get the i18n plugin to work without buying a Swift license?

SSML output below:

Executing command #<Punchblock::Component::Prompt target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 24 Apr 2018 12:43:09 -0500, request_id="0e92c96f-4815-4c25-9f55-3d74aa001d4c", barge_in=true, output=#<Punchblock::Component::Output target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 24 Apr 2018 12:43:09 -0500, request_id="bc0b362e-f684-4e0a-a0ef-84152eca5535", headers={}, voice=nil, interrupt_on=nil, start_offset=nil, start_paused=nil, repeat_interval=nil, repeat_times=nil, max_time=nil, renderer="asterisk", render_documents=[#<Punchblock::Component::Output::Document target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 24 Apr 2018 12:43:09 -0500, url=nil, content_type="application/ssml+xml", value=<speak xmlns="http://www.w3.org/2001/10/synthesis" version="1.0" xml:lang="en-US">
  <audio src="file:///voicemail/sounds/en/voicemail/vm-theperson.wav"/>
  <say-as interpret-as="cardinal">2</say-as>
  <say-as interpret-as="cardinal">5</say-as>
  <say-as interpret-as="cardinal">3</say-as>
  <audio src="file:///voicemail/sounds/en/voicemail/vm-isunavail.wav"/>
</speak>>]>, input=#<Punchblock::Component::Input target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 24 Apr 2018 12:43:09 -0500, request_id="f760cc49-b793-48e7-a77c-7176845653cc", headers={}, max_silence=0, min_confidence=0.5, mode=:dtmf, recognizer=nil, language="en-US", terminator=nil, sensitivity=0.5, initial_timeout=0, inter_digit_timeout=2000, recognition_timeout=nil, grammars=[#<Punchblock::Component::Input::Grammar target_call_id=nil, target_mixer_name=nil, component_id=nil, source_uri=nil, domain=nil, transport=nil, timestamp=Tue, 24 Apr 2018 12:43:09 -0500, value=<grammar xmlns="http://www.w3.org/2001/06/grammar" version="1.0" xml:lang="en-US" mode="dtmf" root="digits">
  <rule id="digits" scope="public">
    <item repeat="0-1">
      <one-of>
        <item>0</item>
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
        <item>5</item>
        <item>6</item>
        <item>7</item>
        <item>8</item>
        <item>9</item>
        <item>#</item>
        <item>*</item>
      </one-of>
    </item>
  </rule>
</grammar>, content_type="application/srgs+xml", url=nil>]>>




James Le Cuirot

unread,
Apr 24, 2018, 6:12:55 PM4/24/18
to adhea...@googlegroups.com
On Tue, 24 Apr 2018 11:05:16 -0700 (PDT)
Steve Sether <st...@sether.org> wrote:

> I'm using the i18n plugin for Adhearsion, but I don't need full text to
> speech, only playing audio files and saying numbers. We've setup swift and
> configured adhearsion to use it. Since we don't need TTS and will rely on
> pre-recorded audio, we'd like to save some licensing costs and use Festival
> (or some other solution). I've tried installing Festival on Asterisk, and
> confirmed that it's working. However, when I configure Adhearsion to use
> Asterisk as the default renderer (config.platform.media.default_renderer =
> :asterisk) I get an error about an unrenderable document:

I don't know about Asterisk and it's been a very long time since I
tried it but I know that Adhearsion supports Flite via FreeSWITCH. I
highly recommend FreeSWITCH over Asterisk anyway, especially for
Adhearsion, but I try not to go on about it. ;)

Regards,
James
Reply all
Reply to author
Forward
0 new messages