playSound

Plays the sound file passed as parameter on the front-end platform.

Syntax

ui.Interface.frontCall("standard", "playSound",
  [resource], [])
  1. resource - The sound file to play.

Usage

The "playSound" front call opens the sound file/resource passed as parameter and plays the sound on the front-end.

Supported sound file format depends on the front-end infrastructure (platform, technology, web browser, etc.)

The sound file must be located on the front-end platform, or be a URI that can be loaded by the front-end.

Tip: It is possible to produce a URI with the ui.Interface.filenameToURI() method, from the file located on the application server. This URI can then be used with the playSound front call.

When using a file name, it can be an absolute or relative path. In a client/server front-end configuration, if the sound file is located on the application server, it is in charge of the program to transfer the file on the front-end platform.

When executing an app on a mobile device, if it is not an absolute path, the sound file path is relative to the appdir.

Tip: When specifying a file path, pay attention to platform specific rules regarding directory separators and space characters in file names. When the front-end executes on a recent Microsoft™ Windows™ system, you can use the / slash character as directory separator, like on Unix systems. A directory or file name can contain spaces, and there is no need to surround the path with double quotes in such case. When using backslash directory separators, make sure to escape backslash characters in string literals with \\.

Example

CALL ui.Interface.frontCall("standard", "playSound", ["beep.mp3"], [])