Note
This API has been available since API level 11.
This API has been available since API level 11.
Controls the audio policy of a webOS system. Implements audio routing (sending audio streams to the proper destinations) and setting volumes in different scenarios.
Its functionality is categorized into the following modules:
In addition, there is a soundSettings category, to manage sound settings such as setting the output device for the audio.
Note: [ Applicable for Master, UMI, and SoundSettings ] The audio service calls the audiooutput service to communicate with the audio hardware layer.
-NA-
API level 11
Establishes connection for the audio resource.
Name | Required | Type | Description |
---|---|---|---|
outputMode | Required | String | Indicates the audio output device. Possible values are:
|
audioType | Required | String | Indicates the type of the audio stream. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
source | Required | String | Indicates the audio source. Possible values are:
|
sourcePort | Required | Number | Audio source port. Possible values are:
|
context | Optional | String | Indicates the audio pipeline ID. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
source | Optional | String | Indicates the audio source. |
sink | Optional | String | Indicates the audio sink. |
Example code
# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
"outputMode":"alsa",
"audioType":"umimedia",
"sink":"ALSA",
"source":"AMIXER",
"sourcePort":0
}'
Response:
{
"source": "AMIXER",
"sink": "ALSA",
"returnValue": true
}
Example scenario
# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
"outputMode":"alsa",
"audioType":"umimedia",
"sink":"ALSA",
"source":"AMIXERTEST",
"sourcePort":0
}'
Response:
{
"errorCode": 4,
"returnValue": false,
"errorText": "Invalid parameters"
}
Example scenario
# luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{
"outputMode":"alsa",
"audioType":"radio",
"sink":"ALSA",
"source":"AMIXER",
"sourcePort":0
}'
Response:
{
"source": "AMIXER",
"sink": "ALSA",
"returnValue": true
}
API level 11
Disconnects the connection.
Name | Required | Type | Description |
---|---|---|---|
sink | Required | String | Indicates the audio sink. Possible values are:
|
source | Required | String | Indicates the audio source. Possible values are:
|
sourcePort | Required | Number | Audio source port. Possible values are:
|
audioType | Required | String | Indicates the audio stream type. Possible values are:
|
context | Optional | String | Indicates the audio pipeline ID. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
source | Optional | String | Indicates the audio source. |
sink | Optional | String | Indicates the audio sink. |
Example code
# luna-send -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{
"sink":"ALSA",
"source":"AMIXER",
"sourcePort":0,
"audioType":"umimedia"
}'
Response:
{
"source": "AMIXER",
"sink": "ALSA",
"returnValue": true
}
API level 11
Shows the connection status of audio resources.
None
Name | Required | Type | Description |
---|---|---|---|
audio | Optional | Object array: audio | Audio connection details. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example code
# luna-send -f -n 1 luna://com.webos.service.audio/UMI/getStatus '{}'
Response:
{
"audio": [
{
"source": "AMIXER",
"sink": "ALSA",
"muted": false,
"outputMode": "alsa"
}
],
"returnValue": true
}
API level 11
Mutes or unmutes the input volume of the requested connection.
Note: This method is added for future-use. It does not have any impact on the audio setting.
Name | Required | Type | Description |
---|---|---|---|
sink | Required | String | Audio sink. Possible values are:
|
source | Required | String | Audio source. Possible values are:
|
sourcePort | Required | Number | Audio source port |
mute | Required | Boolean | Indicates if the input volume is to be muted. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example code
# luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{
"sink":"ALSA",
"source":"AMIXER",
"sourcePort":0,
"mute":true
}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{
"sink":"ALSA",
"source":"AMIXER",
"sourcePort":0,
"mute":false
}'
Response:
{
"returnValue": true
}
API level 21
Check the status of an audio effect.
Name | Required | Type | Description |
---|---|---|---|
effectName | Required | String | Audio effect name. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
enabled | Optional | Boolean | Indicates the current state of the audio effect. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal error |
19 | Invalid parameters | Invalid parameters error |
Example : Checks the status of the speech enhancement audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"speech enhancement"}'
Response:
{
"returnValue": true,
"enabled": true,
}
Example : Checks the status of the gain control audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"gain control"}'
Response:
{
"returnValue" : true,
"enabled": true
}
Example : Checks the status of the beamforming audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"beamforming"}'
Response:
{
"returnValue" : true,
"enabled": true
}
Example : Checks the status of the dynamic compressor audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"dynamic compressor"}'
Response:
{
"returnValue" : true,
"enabled": true
}
Example : Checks the status of the equalizer audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"equalizer"}'
Response:
{
"returnValue" : true,
"enabled": true
}
Example: Check the status of the bass boost audio effect
# luna-send -f -n 1 luna://com.webos.service.audio/checkAudioEffectStatus '{"effectName":"bass boost"}'
Response:
{
"returnValue" : true,
"enabled": true
}
API level 29
Controls playback operations like stop, pause/resume for audio samples that are played using the playSound method.
Name | Required | Type | Description |
---|---|---|---|
playbackId | Required | String | Playback ID of the played stream. |
requestType | Required | String | Audio control type. Possible formats are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Error Code | Error Text | Error Description |
---|---|---|
1, 15, 21 | Depends on error code | See the 'API Error Codes Reference' table for detailed information on relevant error code. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/controlPlayback '{"playbackId":"_utg7654h", "requestType":"stop" }'
Response:
{
"returnValue":true
}
API level 21
Lists all the supported audio effects.
None
Name | Required | Type | Description |
---|---|---|---|
audioEffectList | Optional | String array | List of the available audio effects. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal error |
Example : Lists the supported audio effects
# luna-send -f -n 1 luna://com.webos.service.audio/getAudioEffectList '{}'
Response:
{
"returnValue" : true
"audioEffectList": [
"speech enhancement",
"gain control",
"beamforming",
"dynamic compressor",
"equalizer"
"bass boost"
]
}
API level 24
Gets the status of all the audio effects.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe for notifications on changes to the status of audio effects. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
status | Optional | Object array: effectStatus | Indicates status of audio effects. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
status | Required | Object array: effectStatus | Indicates status of audio effects. |
returnValue | Required | Boolean | Indicates status of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Input parameters provided are incorrect. |
15 | Audiod Internal Error | Internal error |
Example scenario
# luna-send -f -n 1 luna://com.webos.service.audio/getAudioEffectsStatus '{"subscribe":false }'
Response:
{
"subscribed": false,
"returnValue": true,
"status": [
{
"name": "speech enhancement",
"enabled": false
},
{
"name": "gain control",
"enabled": false
},
{
"name": "beamforming",
"enabled": false
},
{
"name": "dynamic compressor",
"enabled": false
},
{
"name": "equalizer",
"enabled": false
},
{
"name": "bass boost",
"enabled": false
}
]
}
API level 12
Gets the input volume for audio streams.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
streamType | Required | String | Indicates the stream name of the input volume to be received. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if the input volume is subscribed to get the notifications. Possible values are:
|
streamType | Optional | String | Indicates the stream name of the input volume to be applied. Check "Parameters" section for list of possible values. |
volume | Optional | Number | Returns the value of applied volume in case of success. Possible range: 0-100 |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if the input volume is subscribed to get the notifications. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
streamType | Optional | String | Indicates the stream name of the input volume to be applied. Check "Parameters" section for list of possible values. |
volume | Optional | Number | Returns the value of applied volume in case of success. Possible range: 0-100 |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong json request. |
15 | Audiod Internal Error | Internal error |
17 | Audiod Unknown Stream | A wrong streamType is requested. |
Example scenario
# luna-send -i -f luna://com.webos.service.audio/getInputVolume '{
"streamType":"default1",
"subscribe":true
}'
Response:
{
"subscribed":true,
"volume":100,
"streamType":"default1",
"returnValue":true
}
API level 29
Checks the status of playback which is played using playSound method.
Name | Required | Type | Description |
---|---|---|---|
playbackId | Required | String | Playback ID of the played stream. |
subscribe | Optional | Boolean | Subscribe for notifications on changes. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
playbackStatus | Optional | String | Playback status. Possible values are
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
playbackStatus | Required | String | Playback status. |
returnValue | Required | Boolean | Indicates the status of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1, 15, 21 | Depends on error code | See the 'API Error Codes Reference' table for detailed information on relevant error code. |
Example scenario
#luna-send -n 1 luna://com.webos.service.audio/getPlaybackStatus '{ "playbackId":"_utg7654h", "subscribe":false }'
Response:
{
"returnValue":true,
"playbackStatus" : "playing",
"subscribed": false
}
API level 13
Gets the current active sound input device.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | String | Subscribe for notifications on changes in the sound input device. Possible values are:
|
displayId | Optional | Number | The display ID with which the sound input device is associated. Possible values are: 0, 1. |
Name | Required | Type | Description |
---|---|---|---|
soundInput | Optional | String | The active sound input device. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
displayId | Optional | Number | The display ID with which the sound input device is associated. |
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
soundInput | Required | String | The active sound input device. |
returnValue | Required | Boolean | Indicates the status of the operation. |
subscribed | Required | Boolean | Indicates whether the request is subscription or not |
displayId | Required | Number | The display ID with which the sound input device is associated. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due to insufficient resource availability in Audiod. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/getSoundInput '{}'
Response:
{
"subscribed":false,
"displayId":0,
"returnValue":true,
"soundInput":"pcm_input"
}
API level 13
Gets the current active sound output device.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe for notifications on changes in the sound output device. Possible values are:
|
displayId | Optional | Number | The display ID with which the sound output device is associated. Possible values are 0, 1. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
soundOutput | Optional | String | The audio output device. |
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. |
displayId | Optional | Number | The display ID with which the sound output device is associated. |
Name | Required | Type | Description |
---|---|---|---|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. |
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. |
displayId | Optional | Number | The display ID with which the sound output device is associated. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due insufficient resource availability in Audiod. |
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/getSoundOutput '{"subscribe":false}'
Response:
{
"subscribed": true,
"returnValue": true,
"displayId": 0,
"soundOutput": "pcm_output"
}
API level 13
Gets input volume of the source.
Name | Required | Type | Description |
---|---|---|---|
sourceType | Required | String | The source for which volume is required. Possible values are:
|
subscribe | Optional | Boolean | Subscribe for notifications on changes in the source volume. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
sourceType | Optional | String | The source for the volume. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
volume | Optional | Number | The source volume. |
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
sourceType | Required | String | The source for the volume. |
returnValue | Required | Boolean | Indicates the status of the operation. |
volume | Required | Number | The source volume. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Audiod invalid schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due to insufficient resource availability. |
23 | AAudiod Unknown Source | Error occurs due to wrong sourceType requested. |
Example : Without subscription
# luna-send -n -i luna://com.webos.service.audio/getSourceInputVolume '{"sourceType":"record"}'
Response:
{
"subscribed":false,
"returnValue":true,
"sourceType":"record",
"volume":100
}
Example : With subscription
# luna-send -n -i luna://com.webos.service.audio/getSourceInputVolume '{"sourceType":"record","subscribe":true}'
Response:
{
"subscribed":true,
"returnValue":true,
"sourceType":"record",
"volume":100
}
Subscription Response:
{
"subscribed":true,
"returnValue":true,
"sourceType":"record",
"volume":75
}
API level 13
Gets the status of the source.
Name | Required | Type | Description |
---|---|---|---|
sourceType | Optional | String | Type of source. Possible values are:
Note: If not specified, all active source details are provided. |
subscribe | Optional | Boolean | Subscribe for notifications on changes in the source. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
sourceObject | Optional | Object array: sourceObject | The list of active source connections. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
sourceObject | Required | Object array: sourceObject | The list of active source connections. |
returnValue | Required | Boolean | Indicates the status of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Audiod invalid schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due insufficient resource availability in Audiod. |
23 | Audiod Unknown Source | Error occurs due to wrong sourceType requested. |
Example : Without sourceType and with subscription
# luna-send -n 1 luna://com.webos.service.audio/getSourceStatus '{"subscribe":true}'
Response:
{
"subscribed": true,
"returnValue": true,
"sourceObject": [
]
}
Example : With sourceType and without subscription
# luna-send -n 1 -f luna://com.webos.service.audio/getSourceStatus '{"sourceType":"record"}'
Response:
{
"subscribed": false,
"returnValue": true,
"sourceObject": [
{
"source": "source",
"sink": "sink",
"activeStatus": true,
"muteStatus": false,
"sourceType": "record",
"inputVolume": 100,
"policyStatus": false
}
]
}
API level 12
Gets the status and information of the active stream.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get the notifications. Possible values are:
|
streamType | Optional | String | Indicates the type of the stream. Note: If not specified, all active stream details are provided. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
streamObject | Optional | Object array: streamObject | Indicates the list of active connections. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. |
subscribed | Optional | Boolean | Indicates if subscribed to get the notifications. |
streamObject | Optional | Object array: streamObject | Indicates the list of active connections. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong json request. |
15 | Audiod Internal Error | Internal error |
17 | Audiod Unknown Stream | A wrong streamType is requested. |
With subscription
# luna-send -i -f luna://com.webos.service.audio/getStreamStatus '{
"streamType":"default1",
"subscribe":true
}'
Response:
{
"streamObject":[
{
"policyStatus":false,
"source":"source",
"inputVolume":100,
"muteStatus":false,
"sink":"sink",
"streamType":"default1",
"activeStatus":true
}
],
"subscribed":true,
"returnValue":true
}
API level 20
Gets the list of supported audio input and output devices and their connection status.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe for notifications on changes. Possible values are:
|
query | Optional | String | Requested category of sound devices. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
returnValue | Required | Boolean | Indicates the status of the request. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of the method for details. |
deviceList | Optional | Object array: deviceList | List of input and output devices. |
Name | Required | Type | Description |
---|---|---|---|
subscribed | Required | Boolean | Indicates if subscribed to get notifications. |
deviceList | Required | Object array: deviceList | List of input and output devices. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal error |
21 | Invalid Parameter | Invalid query provided Wrong value for query parameter. |
Example : List supported input and output devices
# luna-send –n –i luna://com.webos.service.audio/listSupportedDevices '{"subscribe":true,"query":"all"}'
Response:
{
"returnValue" : true,
"subscribed" : true,
"deviceList" : [
{
"type" : "output",
"deviceType" : "internal",
"deviceName": "pcm_output",
"deviceNameDetail" : "bcm HDMI",
"connected" : true,
"displayId" : 0,
"active": true,
"deviceIcon": "audio-card"
},
{
"type" : "output",
"deviceType" : "internal",
"deviceName": "pcm_output1",
"deviceNameDetail" : "bcm HDMI",
"connected" : true,
"displayId" : 1,
"active": true,
"deviceIcon": "audio-card"
},
{
"type" : "output",
"deviceType" : "internal",
"deviceName": "pcm_headphone",
"deviceNameDetail" : "bcm HDMI",
"connected" : true,
"displayId" : 0,
"active": false,
"deviceIcon": "audio-card"
},
{
"type" : "output",
"deviceType" : "external",
"deviceName": "bluetooth_speaker0",
"deviceNameDetail" : "bluetooth_speaker0",
"connected" : false,
"displayId" : 0,
"active": false,
"deviceIcon": ""
},
{
"type" : "output",
"deviceType" : "external",
"deviceName": "usb_speaker0",
"deviceNameDetail" : "usb_speaker0",
"connected" : false,
"displayId" : 0,
"active": false,
"deviceIcon": ""
},
{
"type" : "output",
"deviceType" : "external",
"deviceName": "usb_speaker1",
"deviceNameDetail" : "usb_speaker1",
"connected" : false,
"displayId" : 0,
"active": false,
"deviceIcon": ""
},
{
"type" : "input",
"deviceType" : "external",
"deviceName": "usb_mic0",
"deviceNameDetail" : "usb_mic0",
"connected" : false,
"displayId" : 0,
"active": false,
"deviceIcon": ""
},
{
"type" : "input",
"deviceType" : "external",
"deviceName": "usb_mic1",
"deviceNameDetail" : "usb_mic1",
"connected" : false,
"displayId" : 0,
"active": false,
"deviceIcon": ""
}
]
}
API level 20
Gets volume of currently active microphone input.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Subscribe for notifications on changes. Possible values are:
|
displayId | Optional | Number (int8_t) | The display associated with the microphone. Possible values are:
|
soundInput | Optional | String | Indicates the audio input device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of the method for details. |
soundInput | Optional | String | Input device name. Possible values are:
|
volume | Optional | Number (int8_t) | Device volume. Possible values 0 - 100. |
muteStatus | Optional | Boolean | Mute status of input device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
subscribed | Optional | Boolean | Indicates if subscribed to get notifications. |
returnValue | Optional | Boolean | Indicates the status of the operation. |
soundInput | Optional | String | Input device name. Possible values are:
|
volume | Optional | Number (int8_t) | Device volume. Possible values 0 - 100. |
muteStatus | Optional | String | Mute status of input device. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal error |
20 | DisplayId Not in Range | Wrong displayId parameter supplied |
204 | Volume control is not supported | Invalid sound input value given |
Example : Get volume of active mic input for display 0
#luna-send –n 1 luna://com.webos.service.audio/master/getMicVolume '{}'
Response:
{
"returnValue":true,
"subscribed":false,
"soundInput":"usb_mic0",
"volume":100,
"muteStatus":false
}
API level 11
Gives the current master volume of the audio output device.
Name | Required | Type | Description |
---|---|---|---|
subscribe | Optional | Boolean | Indicates if subscribed to get notifications. Possible values are:
|
soundOutput | Optional | String | Audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
volumeStatus | Optional | Object: VolumeStatus | Indicates the status of volume for different audio output devices. |
callerId | Optional | String | Indicates the luna service name of the calling application. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
volumeStatus | Optional | Object: VolumeStatus | Indicates the status of volume for different audio output devices. |
callerId | Optional | String | Indicates the luna service name of the calling application. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal error |
204 | Volume control is not supported | Invalid sound input value given |
Example : Get master volume
# luna-send -n i -f luna://com.webos.service.audio/master/getVolume '{"subscribe":true}'
Response:
{
"volumeStatus":{
"sessionId":0,
"muted":false,
"volume":100,
"soundOutput":"pcm_output"
},
"returnValue":true,
"callerId":"com.webos.lunasend-2027"
}
Subscription response (after change volume for session 1):
{
"volumeStatus":{
"sessionId":1,
"muted":false,
"volume":50,
"soundOutput":"pcm_output1"
},
"returnValue":true,
"callerId":"com.webos.lunasend-2057"
}
API level 20
Mutes/unmutes the currently active microphone input device.
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number (int8_t) | The display associated with the microphone. Possible values are:
|
mute | Required | Boolean | Mute status of the device. Possible values are:
|
soundInput | Optional | String | Indicates the audio input device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of the method for details. |
soundInput | Optional | String | Input device name. Possible values are:
|
mute | Optional | Boolean | Device mute status. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal Error | Internal Error |
20 | DisplayId Not in Range | Wrong displayId parameter supplied |
204 | Volume control is not supported | Invalid sound input value given |
Example : Mute mic input device
# luna-send –n 1 luna://com.webos.service.audio/master/muteMic '{"soundInput":"usb_mic0","mute":true}'
Response:
{
"returnValue":true,
"soundInput":"usb_mic0",
"mute":true
}
API level 11
Mutes or unmutes the master volume of the audio output device.
Name | Required | Type | Description |
---|---|---|---|
mute | Required | Boolean | Indicates if the master volume is to be muted. Possible values are:
|
sessionId | Optional | Number | Indicates the display/session applicable to the operation. Possible values are:
Note: If not provided, the operation is applied to the audio device connected to both the displays/sessions. |
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
mute | Optional | Boolean | Indicates if the master volume is on mute or not. Possible values are:
|
soundOutput | Optional | String | Indicates the audio output device. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal error | Internal error |
19 | Invalid muteVolume Parameters requested | Wrong parameters in request |
20 | sessionId Not in Range | session id parameter wrong |
204 | "Volume control is not supported | Invalid sound output value given |
Example: Mute volume for sessionId: 0
# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
"soundOutput":"pcm_output",
"mute":true,
"sessionId":0
}'
Response:
{
"mute": true,
"returnValue": true,
"soundOutput": "pcm_output"
}
Example: Mute volume for sessionId 1
# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
"soundOutput":"alsa",
"mute":true,
"sessionId":1
}'
Response:
{
"mute": true,
"returnValue": true,
"soundOutput": "alsa"
}
Example: Unmute volume for sessionId 1
# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
"soundOutput":"alsa",
"mute":false,
"sessionId":1
}'
Response:
{
"mute": false,
"returnValue": true,
"soundOutput": "alsa"
}
API level 20
Sets the volume of the currently active microphone input device.
Name | Required | Type | Description |
---|---|---|---|
displayId | Optional | Number (int8_t) | The display associated with the microphone. Possible values are:
|
volume | Required | Number (int8_t) | The volume to be set. Possible values : 0 - 100. |
soundInput | Optional | String | Indicates the audio input device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of the method for details. |
soundInput | Optional | String | Input device name. Possible values are:
|
volume | Optional | Number (int8_t) | Device volume. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
3 | SoundInput volume is not in range | Sound Input volume is not in range |
15 | Audiod Internal Error | Internal error |
20 | DisplayId Not in Range | Wrong displayId parameter supplied |
204 | Volume control is not supported | Invalid sound input value given |
Example : Set volume as 50
#luna-send –n 1 luna://com.webos.service.audio/master/setMicVolume '{"soundInput":usb_mic0,"volume":50}'
Response:
{
"returnValue":true,
"soundInput":"usb_mic0",
"volume":50
}
API level 11
Sets the master volume of the audio output device.
Name | Required | Type | Description |
---|---|---|---|
sessionId | Optional | Number | Indicates the display/session applicable to the operation. Possible values are:
Note: If not provided, the operation is applied to session 0. |
soundOutput | Required | String | Indicates the target sound output device. Possible values are:
|
volume | Required | Number | Indicates the volume level to be set. Possible range: 0-100 |
Name | Required | Type | Description |
---|---|---|---|
volume | Optional | Number | Indicates the current volume level. Possible range: 0-100 |
soundOutput | Optional | String | Indicates the target sound output device. |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
3 | SoundOutput volume is not in range | Volume value not in range |
15 | Audiod Internal error | Internal error |
20 | sessionId Not in Range | session id parameter wrong |
204 | Volume control is not supported | Invalid sound output value given |
Example: Set volume as 57 for sessionId 0
# luna-send -f -n 1 luna://com.webos.service.audio/master/setVolume '{
"soundOutput":"pcm_output",
"volume":57,
"sessionId":0
}'
Response:
{
"volume": 57,
"returnValue": true,
"soundOutput": "pcm_output"
}
API level 11
Reduces the master volume of the device.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
sessionId | Optional | Number | Indicates the display/session applicable to the operation. Possible values are:
Note: If not provided, the operation is applied to session 0. |
Name | Required | Type | Description |
---|---|---|---|
volume | Optional | Number | Indicates the current level of volume. Possible range: 0-100 |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
soundOutput | Optional | String | Indicates the audio sound output device. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal error | Internal error |
19 | Invalid volumeDown Parameters requested | Wrong parameters in request |
20 | sessionId Not in Range | session id parameter wrong |
204 | Volume control is not supported | Invalid sound output value given |
Example: Reduce the volume for sessionId 0
# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeDown '{
"soundOutput":"pcm_output",
"sessionId":0
}'
Response:
{
"volume": 11,
"returnValue": true,
"soundOutput": "pcm_output"
}
Example: Reduce the volume for sessionId 1
# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeDown '{
"soundOutput":"alsa",
"sessionId":1
}'
Response:
{
"volume": 49,
"returnValue": true,
"soundOutput": "alsa"
}
API level 11
Increases the master volume of the device.
Name | Required | Type | Description |
---|---|---|---|
sessionId | Optional | Number | Indicates the display/session applicable to the operation. Possible values are:
Note: If not provided, the operation is applied to session 0. |
soundOutput | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
volume | Optional | Number | Indicates the current level of volume. Possible range: 0-100 |
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
soundOutput | Optional | String | Indicates the audio output device. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
15 | Audiod Internal error | Internal error |
20 | sessionId Not in Range | session id parameter wrong |
204 | Volume control is not supported | Invalid sound output value given |
Example: Increase the volume for sessionId 0
# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeUp '{
"soundOutput":"pcm_output",
"sessionId":0
}'
Response:
{
"volume": 12,
"returnValue": true,
"soundOutput": "pcm_output"
}
Example: Increase the volume for sessionId 1
# luna-send -f -n 1 luna://com.webos.service.audio/master/volumeUp '{
"soundOutput":"alsa",
"sessionId":1
}'
Response:
{
"volume": 20
"returnValue": true,
"soundOutput": "alsa"
}
API level 11
Sets the volume level of the current or the specified scenario.
Name | Required | Type | Description |
---|---|---|---|
volume | Required | Number | Indicates the volume level to be set. |
sessionId | Optional | Number | Indicates the display/session to which the operation is applicable. Possible values are:
Note: If not provided, the operation is applied to session 0. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "Error Codes" section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Wrong JSON message format |
2 | "Missing 'volume' integer parameter." | Mandatory Parameter Volume has to be specified |
3 | "failed to set parameter (invalid scenario name?)" | Volume for the scenario could not be set. Check for the validity of scenario |
3 | Invalid 'volume' integer parameter value or file not found. | Volume value is not valid. It should be between 0 and 100. |
Example: With volume
# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":10}'
Response:
{
"returnValue": true
}
Example: display1
# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":50, "sessionId":0}'
Response:
{
"returnValue": true
}
Example: display 2
# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":50, "sessionId":1}'
Response:
{
"returnValue": true
}
API level 13
Mutes the sink volume.
Name | Required | Type | Description |
---|---|---|---|
streamType | Required | String | The sink to be muted. Possible values are:
|
mute | Required | Boolean | Mute or unmute the sink. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
streamType | Optional | String | The sink that is muted/unmuted. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
mute | Optional | Boolean | Indicates the mute status of the sink. |
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Audiod invalid schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due insufficient resource availability in Audiod. |
17 | Audiod Unknown Source | A wrong streamType is requested. |
Example : Mute the sink default1
# lluna-send -n 1 luna://com.webos.service.audio/muteSink '{"streamType":"default1","mute":true}'
Response:
{
"returnValue":true,
"streamType":"default1",
"mute":true
}
API level 13
Mutes the source volume.
Name | Required | Type | Description |
---|---|---|---|
sourceType | Required | String | The source to be muted. Possible values are:
|
mute | Required | Boolean | Mute or unmute the source. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
sourceType | Optional | String | The source that is muted/unmuted. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
mute | Optional | Boolean | Indicates the mute status of the source. |
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Audiod invalid schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due insufficient resource availability in Audiod. |
23 | Audiod Unknown Source | Error occurs due to wrong sourceType requested. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/muteSource '{"sourceType":"record","mute":true}'
Response:
{
"returnValue":true,
"sourceType":"record",
"mute":true
}
API level 12
Plays PCM audio files through PulseAudio sound server.
Name | Required | Type | Description |
---|---|---|---|
fileName | Required | String | Indicates the absolute path of the PCM file to be played. |
sink | Required | String | Indicates the virtual PulseAudio sink used by the application. Possible values are:
|
format | Optional | String | Indicates the sample format to be set. Possible formats are:
|
sampleRate | Optional | Number | Indicates the sample rate to be set. Possible rates are:
|
channels | Optional | Number | Indicates the number of audio channels to be used while playing the file. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | Indicates the reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
playbackId | Optional | String | Playback ID of the played stream. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong json request. |
19 | Invalid file format | Invaild file format provided |
19 | Invalid virtual sink name | Invaild virtual sink name provided |
19 | Invalid sample format | Invaild sample format provided |
19 | Invalid channel count | Invaild channel count provided |
19 | Invalid sample rate | Invaild sample rate provided |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/playSound '{
"fileName":"/usr/share/audiod/systemsounds/voicestart-ondemand.pcm",
"sink":"default1",
"sampleRate":48000,
"format":"PA_SAMPLE_S16LE",
"channels":2
}'
Response:
{
"returnValue":true,
"playbackId" : "_utg7654h"
}
API level 16
Registers a playback by an application/service and returns a track ID.
The track ID must be used to control the volume of that particular playback by using setTrackVolume().
Name | Required | Type | Description |
---|---|---|---|
streamType | Required | String | Type of the audio stream. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
trackId | Optional | String | Track ID of the registered playback. |
streamType | Optional | String | Type of the audio stream. |
Example : Register a track
# luna-send -n 1 -f luna://com.webos.service.audio/registerTrack '{"streamType":"default1"}
Response:
{
"trackId": "_OOWR1nOw9",
"returnValue": true
}
API level 21
Sets the status of an audio effect.
Name | Required | Type | Description |
---|---|---|---|
effectName | Required | String | Audio effect name. Possible values are:
|
enabled | Required | Boolean | Status of the audio effect. Possible values are:
Note: By default, all the audio effects are disabled. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'Error Codes' section of this method for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
5 | SoundInput not connected | SoundInput device not available |
7 | AGC Already Enabled | AGC feature is already enabled |
15 | Audiod Internal Error | Internal Error |
19 | Invalid parameters | Invalid parameters error |
Example : Enable speech enhancement effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"speech enhancement", "enabled":true}'
Response:
{
"returnValue": true
}
Example : Enable gain control effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"gain control", "enabled":true}'
Response:
{
"returnValue" : true
}
Example : Enable beamforming effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"beamforming", "enabled":true}'
Response:
{
"returnValue" : true
}
Example : Enable dynamic compressor effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"dynamic compressor", "enabled":true}'
Response:
{
"returnValue" : true
}
Example : Enable equalizer effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"equalizer", "enabled":true}'
Response:
{
"returnValue" : true
}
Example: Enable bass boost effect
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEffect '{"effectName":"bass boost", "enabled":true}'
Response:
{
"returnValue" : true
}
API level 25
Sets the equalizer band level.
Name | Required | Type | Description |
---|---|---|---|
band | Required | Number | Band index of the equalizer band. Value range: [0, 5] (6 bands) |
level | Required | Number | New gain (in decibels) for the specified band. Value range: [-10, 10] |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Incorrect parameters are provided. |
15 | Audiod Internal Error | Internal error |
19 | Invalid parameters | Invalid parameters error |
Example : Set the equalizer band level
# luna-send -f -n 1 luna://com.webos.service.audio/setAudioEqualizerBandLevel '{"band":1, "level":-5}'
Response:
{
"returnValue" : true
}
API level 25
Sets the equalizer preset value.
Name | Required | Type | Description |
---|---|---|---|
preset | Required | Number | ID of equalizer preset. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Incorrect parameters are provided. |
15 | Audiod Internal Error | Internal error |
19 | Invalid parameters | Invalid parameters error |
Example: Set the equalizer preset
#luna-send -f -n 1 luna://com.webos.service.audio/setAudioEqualizerPreset '{"preset":1}'
Response:
{
"returnValue" : true
}
API level 12
Sets the input volume for audio streams.
Name | Required | Type | Description |
---|---|---|---|
streamType | Required | String | Indicates the stream name of the input volume to be applied. Possible values are:
|
volume | Required | Number | Indicates the volume to be applied. Possible range: 0-100 |
ramp | Optional | Boolean | Indicates if the volume is to be applied in steps. Possible values are:
Default: false |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
volume | Optional | Number | Returns the value of applied volume in case of success. Possible range: 0-100 |
streamType | Optional | String | Returns the stream name of the volume applied. |
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong json request. |
3 | Volume Not in Range | Error occurs due to invalid volume level. |
15 | Audiod Internal Error | Internal error |
17 | Audiod Unknown Stream | A wrong streamType is requested. |
Example code
# luna-send -n 1 luna://com.webos.service.audio/setInputVolume '{
"streamType":"default1",
"volume":50
}'
Response:
{
"volume":50,
"returnValue":true,
"streamType":"default1"
}
API level 13
Sets the sound input device for recording.
Name | Required | Type | Description |
---|---|---|---|
soundInput | Required | String | The sound input device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
soundInput | Optional | String | The sound input device that is set. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong JSON request. |
15 | Audiod internal error | Error occurs due to insufficient resource availability in Audiod. |
24 | Audiod Unknown sound input | Error occurs due to unsupported soundinput requested. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/setSoundInput '{"soundInput":"pcm_input"}'
Response:
{
"returnValue":true,
"soundInput":"pcm_input"
}
API level 13
Sets the sound output device.
Name | Required | Type | Description |
---|---|---|---|
soundOutput | Required | String | The audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
soundOutput | Optional | String | The audio output device. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Invalid number of input parameters against defined schema of the method |
204 | Audiod Unknown soundOutput | Invalid sound output value given |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/setSoundOutput '{"soundOutput":"pcm_output"}'
Response:
{
"returnValue":true,
"soundOutput":"pcm_output"
}
API level 13
Sets input volume of the source.
Name | Required | Type | Description |
---|---|---|---|
sourceType | Required | String | The source to which volume must be applied. Possible values are:
|
volume | Required | Number | The volume level to be applied to the source Possible range: 0-100 |
ramp | Optional | Boolean | Indicates if the volume is to be applied in steps. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
volume | Optional | Number | The updated volume level. |
sourceType | Optional | String | The source to which the volume is set. |
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorText | Optional | String | The reason for the failure of the operation. |
errorCode | Optional | Number | The error code for the failed operation. |
Error Code | Error Text | Error Description |
---|---|---|
1 | Audiod invalid schema | Error occurs due to wrong JSON request. |
3 | Volume Not in Range | Error occurs due to invalid volume level. |
15 | Audiod internal error | Error occurs due to insufficient resource availability in Audiod. |
23 | Audiod Unknown Source | Error occurs due to wrong sourceType requested. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/setSourceInputVolume '{"sourceType":"record","volume":10}'
Response:
{
"returnValue":true,
"sourceType":"record",
"volume":10
}
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/setSourceInputVolume '{"sourceType":"record","volume":100, "ramp":false}'
Response:
{
"returnValue":true,
"sourceType":"record",
"volume":100
}
API level 16
Sets the volume for a specific playback that is identified by the track ID (obtained by using registerTrack()).
The effective playback volume is calculated as a percentage of the stream volume of the corresponding track.
Example 1:
Example 2:
Example 3:
Name | Required | Type | Description |
---|---|---|---|
trackId | Required | String | Track ID of the registered playback. |
volume | Required | Number | Volume level to be set. The valid volume range is 0-100 |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
trackId | Optional | String | Track ID for which the volume is set. |
volume | Optional | Number | Volume level that is set. |
streamType | Optional | String | Type of audio stream. |
Example : Set the playback volume
# luna-send -n 1 -f luna://com.webos.service.audio/setTrackVolume '{"trackId":"_rKjYAlq3r","volume":50}'
Response:
{
"returnValue": true,
"trackId": "_rKjYAlq3r",
"volume": 50,
"streamType": "default1"
}
API level 11
Sets the audio output device.
Name | Required | Type | Description |
---|---|---|---|
soundOut | Required | String | Indicates the audio output device. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
soundOut | Optional | String | Indicates the audio output device. Possible values are:
|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details. |
Example code
# luna-send -n 1 -f luna://com.webos.service.audio/soundSettings/setSoundOut '{"soundOut":"alsa"}'
Response:
{
"soundOut": "alsa",
"returnValue": true
}
API level 11
Plays the various system alert sounds based on the name passed to it.
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | Name of the system sound. |
sink | Optional | String | Sink to use to play sound (default: pfeedback). |
play | Optional | Boolean |
|
override | Optional | Boolean | Override feedback sound. Possible values are:
|
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean |
|
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Error occurs due to wrong json request. |
2 | Missing 'name' string parameter. | 'name' parameter is missed. |
3 | Invalid 'name' string parameter value or file not found | Invalid 'name' parameter is provided. |
3 | Invalid 'sink' string parameter value or file not found. | Invalid 'sink' parameter is provided. |
Example code
# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{
"name":"voicestart",
"sink":"pfeedback",
"play":true
}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{
"name":"voicestart",
"sink":"pfeedback",
"play":false
}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart", "play":false}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart"}'
Response:
{
"returnValue": true
}
Example scenario
# luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "shutter"}'
Response:
{
"returnValue": true
}
API level 11
Gives the audiod information regarding the USB Mic/Headset Connected/Disconnected events based on the udev rules.
It also provides the sound card number and device number information.
Name | Required | Type | Description |
---|---|---|---|
event | Required | String | The event to be passed to audiod by the udev rule when USB soundcard is detected.It is a simple string defined by audiod. For example supported events are:
|
soundcard_no | Optional | Number | Sound card number. As of now it is being extracted from the device path where USB sound card is detected by udev. |
device_no | Optional | Number | Device number. As of now it is being extracted from the device path where USB sound card is detected by udev. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | If the method succeeds, returnValue will contain true. |
errorCode | Optional | Number | errorCode contains the error code if the method fails. The method will return errorCode only if it fails. |
errorText | Optional | String | errorText contains the error text if the method fails. The method will return errorText only if it fails. |
Example scenario
# luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"headset-inserted"}'
Response:
{
"returnValue":true
}
API level 16
Unregisters a playback by an application/service.
Name | Required | Type | Description |
---|---|---|---|
trackId | Required | String | Track ID of the registered playback. |
Name | Required | Type | Description |
---|---|---|---|
returnValue | Required | Boolean | Indicates the status of the operation. Possible values are:
|
errorCode | Optional | Number | The error code for the failed operation. |
errorText | Optional | String | The reason for the failure of the operation. See the 'API Error Codes Reference' section for details. |
trackId | Optional | String | Track ID that is unregistered. |
Example : Unregister a registered track
# luna-send -n 1 -f luna://com.webos.service.audio/unregisterTrack '{"trackId":"_OOWR1nOw9"}'
Response:
{
"returnValue": true,
"trackId": "_OOWR1nOw9"
}
Provides the volume details of the target sound output device.
Name | Required | Type | Description |
---|---|---|---|
muted | Required | Boolean | Indicates if the audio is on mute or not. Possible values are:
|
volume | Required | Number | Indicates the current volume level. Note: Returns a value only if the audio is not on mute. |
soundOutput | Required | String | Indicates the target sound output device. Possible values:
|
sessionId | Required | Number | Indicates the volume status of the targeted display/session. Possible values are:
|
Object returned by the UMI/getStatus.
Name | Required | Type | Description |
---|---|---|---|
source | Required | String | Indicates the audio source. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
muted | Required | Boolean | Indicates if the audio is muted. Possible values are:
|
outputMode | Required | String | Indicates the audio output device. Possible values are:
|
Provides information about all supported input and output devices and their type and connection status.
Name | Required | Type | Description |
---|---|---|---|
type | Required | String | Indicates if device is input or output device. Possible values are:
|
deviceType | Required | String | Indicates if the device is internal or external device. Possible values are:
|
deviceName | Required | String | Device name internal. Possible values are:
|
deviceNameDetail | Required | String | Device full name. Note: It is based on name of the device which will vary based on different sound cards. |
connected | Required | Boolean | Indicates device connection status. Possible values are:
|
displayId | Required | Number | Display id to which the device is associated. Possible values are:
|
active | Required | Boolean | Status of the device. Possible values are:
|
deviceIcon | Required | String | Name of the icon used for the device. |
Provides the name of the audio effects and their status.
Name | Required | Type | Description |
---|---|---|---|
name | Required | String | Name of the audio effect. Possible values are:
|
enabled | Required | Boolean | Status of the audio effect. Possible values are:
Note: By default, all the audio effects are disabled |
Indicates the list of active source connection
Name | Required | Type | Description |
---|---|---|---|
activeStatus | Required | Boolean | Indicates whether the source is active. Possible values are:
|
inputVolume | Required | Number | Indicates the input volume of the source. Values range from 0 to 100. |
muteStatus | Required | Boolean | Indicates if the audio is muted. Possible values are:
|
policyStatus | Required | Boolean | Indicates if the policy for the sources is in progress. Possible values are:
|
sink | Required | String | Indicates the audio sink. Possible values are:
|
source | Required | String | Indicates the audio source. Possible values are:
|
sourceType | Required | String | Indicates the active source connection. Possible values are:
|
Contains the list of active connections.
Name | Required | Type | Description |
---|---|---|---|
activeStatus | Required | Boolean | Indicates whether the stream is active. Possible values are:
|
inputVolume | Required | Number | Indicates the input volume of the stream. Values range from 0 to 100. |
muteStatus | Required | Boolean | Indicates if the audio is muted. Possible values are:
|
policyStatus | Required | Boolean | Indicates if the policy for the streams is in progress. Possible values are:
|
sink | Optional | String | Indicates the audio sink. Possible values are:
|
source | Optional | String | Indicates the audio source. Possible values are:
|
streamType | Required | String | Indicates the active stream names. Possible values are:
|
Error Code | Error Text | Error Description |
---|---|---|
1 | Could not validate json message against schema | Failed to validate against defined schema of the method |
3 | Invalid volume control | AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE |
3 | Volume limit reached | AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE |
15 | Audiod Internal Error | Internal Error. |
16 | Audiod internal error | AUDIOD_ERRORCODE_INVALID_MIXER_INSTANCE |
17 | Audiod Unknown Stream | A wrong streamType is requested. |
17 | Audiod internal error | AUDIOD_ERRORCODE_FAILED_MIXER_CALL |
18 | Audiod internal error | AUDIOD_ERRORCODE_INVALID_ENVELOPE_INSTANCE |
19 | Audiod internal error | AUDIOD_ERRORCODE_INVALID_AUDIO_TYPE |
20 | Unknown error | AUDIOD_ERRORCODE_UNKNOWN_ERROR |
21 | Invalid parameters | Invalid parameters error. |
22 | Not supported | AUDIOD_ERRORCODE_NOT_SUPPORTED |
22 | Driver error | AUDIOD_ERRORCODE_NOT_SUPPORTED |
22 | Audio not connected | AUDIOD_ERRORCODE_NOT_SUPPORTED |
22 | Soundout type not supported | AUDIOD_ERRORCODE_NOT_SUPPORTED |
22 | Connection not supported | AUDIOD_ERRORCODE_NOT_SUPPORTED |
23 | Invalid schema | AUDIOD_ERRORCODE_INVALID_SCHEMA |
25 | Audiod Unknown trackId | A wrong trackId is passed. |
200 | Audio not connected | Audio not connected |
204 | Volume control is not supported | Volume control is not supported |
Contents