Content
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.
Please note:Â Â A fragment which is added to an URL that is added to a minibrowser.htm call will (only) be handled if the IP address of the URL is added to the setting mb_trusted_hosts or if the URL is already trusted (e.g. a local XML)
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_OF_WAV_FILE
For example:
#action_ifc:pui=play_wav,url=http://10.110.16.61/melody1.wav
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 stopping WAV files. For using this example, replace YOUR_URL with the HTTP path to your wav files (for example http://10.110.16.61/). The example assumes to find under this path 3 audio files named: test1.wav, test2.wav and test3.wav.
<?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 consume_key_event="1">phone://mb_nop#action_ifc:pui=play_wav,url=YOUR_URL/test__ID__.wav&var:selid=__ID__&var:playid=__ID__</Url>
</SoftKeyItem>
<SoftKeyItem>
<Name>F2</Name>
<Label>F_STOP</Label>
<Url consume_key_event="1">phone://mb_nop#action_ifc:pui=stop_wav&var:playid=0</Url>
</SoftKeyItem>
<SoftKeyItem>
<Name>F4</Name>
<Label>F_CANCEL</Label>
<Url>phone://mb_nop#go_back&action_ifc:pui=stop_wav&var:playid=0</Url>
</SoftKeyItem>
<SoftKeyItem>
<Name>ENTER</Name>
<Url consume_key_event="1">phone://mb_nop#action_ifc:pui=play_wav,url=YOUR_URL/test__ID__.wav&var:selid=__ID__&var:playid=__ID__</Url>
</SoftKeyItem>
<SoftKeyItem>
<Name>CANCEL</Name>
<Url>phone://mb_nop#go_back&action_ifc:pui=stop_wav&var:playid=0</Url>
</SoftKeyItem>
</MenuItem>
</Repeat>
</IPPhoneMenu>
And here you can see how it looks like on the phone:
