Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.
loopingrage edited this page Dec 1, 2011 · 1 revision

The Output Component offers fine-grained access to TTS and Audio Streaming resources.

This is component is still under active development. The API does look like this:

<iq type='set' to='9f00061@call.rayo.net/1' from='16577@app.rayo.net/1'>
  <output xmlns='urn:xmpp:rayo:output:1' 
        interrupt-on='any|dtmf|speech|none'
        start-offset='2000'
        start-paused='false'
        repeat-interval='2000'
        repeat-times='10'
        max-time='30000'
        voice='allison'>
    <audio src='http://acme.com/greeting.mp3'>
        Thanks for calling ACME company
    </audio>
    <audio src='http://acme.com/package-shipped.mp3'>
        Your package was shipped on
    </audio>
    <say-as interpret-as='date'>12/01/2011</say-as>
  </output>
</iq>

Commands

  <!-- Pause playback -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <pause xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

  <!-- Resume Playback -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <resume xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

  <!-- Completely stop the Output Component -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <stop xmlns='urn:xmpp:rayo:ext:1' />    
  </iq>

  <!-- Move to another position in the prompt -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <seek xmlns='urn:xmpp:rayo:output:1' direction='forward|back' amount='15000' />
  </iq>

  <!-- Increase playback speed -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <speed-up xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

  <!-- Decrease playback speed -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <speed-down xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

  <!-- Increase playback volume -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <volume-up xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

  <!-- Decrease playback volume -->
  <iq type='set' to='9f00061@call.rayo.net/fgh4590' from='16577@app.rayo.net/1'>
    <volume-down xmlns='urn:xmpp:rayo:output:1' />    
  </iq>

Events

  <!-- Playback completed successfully -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <success xmlns='urn:xmpp:rayo:output:complete:1' />
    </complete>
  </presence>
  
  <!-- Component was stopped -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <stop xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>
  
  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <hangup xmlns='urn:xmpp:rayo:ext:complete:1' />
    </complete>
  </presence>

  <!-- Component completed because the call was disconnected -->
  <presence to='16577@app.rayo.net/1' from='9f00061@call.rayo.net/fgh4590'>
    <complete xmlns='urn:xmpp:rayo:ext:1'>
      <error xmlns='urn:xmpp:rayo:ext:complete:1'>
        Something really bad happened
      </error>
    </complete>
  </presence>