BBjSysGui::playSoundData
Description
In BBj 22.0 and higher, this method plays the sound encoded in a string of bytes.
Syntax
Return Value | Method |
---|---|
void | playSoundData(string bytes) |
void | playSoundData(string bytes, boolean loop) |
void | playSoundData(string bytes, boolean loop, string mime) |
Parameters
Variable | Description |
---|---|
url | The raw byte data of the audio to play, or "" to stop playing previously specified audio. |
loop | If this boolean value is true, the audio will play in a loop until stopped. |
mime | The BUI client requires an audio MIME type, which can usually be determined automatically from the sound data. If it's unable to automatically determine the MIME type (e.g. "audio/wav"), you can explicitly specify it here. |
Return Value
None.
Remarks
Each client defines its own set of supported audio formats. Browsers support a broad range of formats, but the Java GUI client is usually limited to AU, AIFF, and WAV.
Browsers only allow sounds to play after the user has interacted with the page. In BUI and DWC, any attempt to play sounds during application startup is ignored, but sounds work as expected after the user has interacted with the page.
Example
|
Version History
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.
HTML5 Audio: Supported audio coding formats