System Sounds
The System Sounds service (com.palm.audio/systemsounds) plays audio feedback in response to user interaction. The sounds play as soon as the message is played, with low latency.
playFeedback
Plays a system sound by using the "feedback" stream class. Intended for UI feedback, such as UI button clicks, keypad clicks, and other similar sounds.
Syntax
{
"name" : string
}
Parameters
| Parameter | Required | Type | Description |
| name | Yes | string |
The sample name. The following are the supported names, which are subject to change:
|
Returns
{
returnValue : boolean,
errorText : string
}
| Attribute | Required | Type | Description |
| returnValue | Yes | boolean | true (success) or false (failure) |
| errorText | No | string | Error message returned on failure. |
Examples
luna-send
luna-send -n 1 luna://com.palm.audio/systemsounds/playFeedback '{"name": "card_01"}'
{"returnValue":true}
Enyo
enyo.kind({
name : "enyo.SysSounds",
kind : enyo.VFlexBox,
components : [
{ flex : 1,
kind : "Pane",
components : [{
flex : 1,
kind : "Scroller",
components : [{
name : "makeSysSound",
kind : "PalmService",
service : "palm://com.palm.audio/systemsounds",
method : "playFeedback",
onSuccess : "makeSoundSuccess",
onFailure : "makeSoundFailure"
},
{kind : "Button", name : "makeSoundButton", caption : "Make Sound", onclick : "makeSoundClick"}
]
}]
}],
makeSoundClick: function() {
this.$.makeSysSound.call({"name": "appclose"});
},
makeSoundSuccess: function(inSender, inResponse) {
this.log("Make sound success, results=" + enyo.json.stringify(inResponse));
},
// Log errors to the console for debugging
makeSoundFailure: function(inSender, inError, inRequest) {
this.log(enyo.json.stringify(inError));
}
});
Mojo
this.controller.serviceRequest("palm://com.palm.audio/systemsounds", {
method: "playFeedback",
parameters: {
name: "dtmf_2"
},
onSuccess:{},
onFailure:{}
});
Sample Code
See Services Sample.