Child pages
  • How to play audio files from URL


Since version 10.1.53.0 two new functions "play_wav" and "stop_wav" are added to the PUI action interface. Now you can create a XML file to play and stop WAV files from an URL. The action interface can be used as an URL fragment.


The syntax ot the PUI action interface URL fragment is:

"#action_ifc:pui=<function>".


The function for playing a WAV file "play_wav" needs the URL parameter "url=" with the URL of the WAV file as value. The parameter is separated from the function with a comma:

#action_ifc:pui=play_wav,url=<URL>


The function for stopping the WAV file "stop_wav" has no parameter:

#action_ifc:pui=stop_wav


The supported audio format is the same that is supported for custom ring tones (How do I apply customized ringtones and what is the required format):

PCM, 8 KHz, 16bit mono.


Here is an example XML file for playing and stoping WAV files:

Click here to expand the XML file ...
<?xml version="1.0" encoding="UTF-8"?>
<IPPhoneMenu dtmf="off" id="play_wav_url" speedselect="on" scrollbar="true" state="others_except_mb">
  <Title>Play WAV Files</Title>
  <IconSize>XXS</IconSize>
  <Repeat values="$(enum:3)" token="|__ID__|">
    <MenuItem name="Wav-__ID__" sel="$(condition:__ID__==$(var:selid))">
      <IconType>$(icon_type_enum:kIconTypeStatusMessageMessage)</IconType>
      <Subtext>00:20</Subtext>
      <If condition="__ID__==$(var:playid)">
        <ExtraIconType>$(icon_type_enum:kIconTypeStopCallRecording)</ExtraIconType>
      </If>
      <Else>
        <ExtraIconType>$(icon_type_enum:kIconTypeMenuPlay)</ExtraIconType>
      </Else>
      <SoftKeyItem>
        <Name>F1</Name>
        <Label>F_PLAY</Label>
        <Url>phone://mb_nop#action_ifc:pui=play_wav,url=<URL>/test__ID__.wav&amp;var:selid=__ID__&amp;var:playid=__ID__</Url>
      </SoftKeyItem>
      <SoftKeyItem>
        <Name>F2</Name>
        <Label>F_STOP</Label>
        <Url>phone://mb_nop#action_ifc:pui=stop_wav&amp;var:playid=0</Url>
      </SoftKeyItem>
      <SoftKeyItem>
        <Name>F4</Name>
        <Label>F_CANCEL</Label>
        <Url>phone://mb_nop#go_back&amp;action_ifc:pui=stop_wav&amp;var:playid=0</Url>
      </SoftKeyItem>
      <SoftKeyItem>
        <Name>ENTER</Name>
        <Url>phone://mb_nop#action_ifc:pui=play_wav,url=<URL>/test__ID__.wav&amp;var:selid=__ID__&amp;var:playid=__ID__</Url>
      </SoftKeyItem>
      <SoftKeyItem>
        <Name>CANCEL</Name>
        <Url>phone://mb_nop#go_back&amp;action_ifc:pui=stop_wav&amp;var:playid=0</Url>
      </SoftKeyItem>
    </MenuItem>
  </Repeat>
</IPPhoneMenu>



And here you can see how it looks like on the phone: