com.webos.service.audio

API Summary

This service controls the audio policy of a webOS system. Its role is to implement audio routing (sending audio streams to the proper destinations) and setting volumes in different scenarios.

Its functionality is categorized into the following modules:

  • Master - To control the master volume of audio output devices.
  • UMI - Handles connections and manages volume for audio resources, when playing audio from applications like YouTube.
  • System - To control audio policy for DTMF (touch tones), alarm, calendar, and effects.
  • Media - To control audio policy for media playback.
  • Ringtone - To control audio policy for ringtone.
  • Alert - To control audio policy for for alerts.

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.

Overview of the API

(click to expand)

NA


Open All


media/broadcastEvent

Description

Announce an event to audiod.

Parameters

Name

Required

Type

Description

eventRequiredString

The event to be passed to audiod by the application. It can be simple string agreed between audiod and application.

For example, if audiod requires an event when call is received by caller (i.e., application), it will ask the caller to send an event using this method and the event will be "callreceived".

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2Missing event string parameter.

Mandatory parameter event is missing from input arguments.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/broadcastEvent '{"event":"test"}'


media/disableScenario

Description

Disable the specified scenario.

Note: This method is added for future-use. Do not use it to disable any of the scenarios.

Parameters

Name

Required

Type

Description

scenarioRequiredstring

Scenario to be disabled.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2Missing ‘scenario’ string parameter.

Mandatory parameter Scenario is missing from input arguments.

3Could not disable requested scenario.

Request Scenario is valid. But could not be disabled.

3"Invalid 'scenario' string parameter value or file not found.

Request scenario for disabling is not valid scenario.

Example


media/enableScenario

Description

Enable the specified scenario.

Parameters

Name

Required

Type

Description

scenarioRequiredstring

Scenario to be enabled.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2Missing ‘scenario’ string parameter.

Mandatory parameter Scenario is missing from input arguments.

3Invalid 'scenario' string parameter value

Request Scenario for enabling is not a valid scenario.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/enableScenario '{"scenario":"media__default"}'


media/getCurrentScenario

Description

Get a current scenario.

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorText" field for details.
errorTextOptionalString

Indicates the reason for the failure of the operation.

scenarioOptionalString

Scenario currently selected.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/getCurrentScenario '{}'

Returns:
{
    "scenario": "media__default",
    "returnValue": true
}


media/getLatency

Description

Get the latency for the specified scenario.

Parameters

Name

Required

Type

Description

scenarioOptionalString

Scenario to get the latency value for.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

scenarioOptionalString

Current media scenario

latencyOptionalNumber

Current latency set for media.

Error References

Error Code

Error Text

Error Description

3failed to get latency (invalid scenario name?)

Failure to fetch latency may be due to invalid scenario name.

Example

luna-send -n 1 luna://com.webos.service.audio/media/getLatency '{}'

Returns:

{

"returnValue":true,

"scenario":"media__default",

"latency":65536

}


media/getMicGain

Description

Get mic gain of the current or specified scenario.

Parameters

Name

Required

Type

Description

scenarioOptionalString

Scenario to get the mic gain for. If not specified, currently selected scenatio will be used.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

mic_gainOptionalNumber

Mic gain [0 -100] of current or specified scenario.

scenarioOptionalString

Either the scenario specified in the input of this method or the currently selected scenario.

Error References

Error Code

Error Text

Error Description

3failed to get parameter (invalid scenario name?)"

Failed to get the Mic Gain. Check for Scenario Name.

Example

luna-send -n 1 luna://com.webos.service.audio/media/getMicGain '{}'

Returns:

{

"returnValue":true,

"scenario":"media__default",

"mic_gain":-1

}


media/getVolume

Description

Get the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

scenarioOptionalstring

Scenario for which to get the volume level. If not specified, the volume is retrieved from currently selected scenario.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation.

scenarioOptionalString

Scenario from which volume level is obtained.

volumeOptionalNumber

Current volume [0, 100].

Example

luna-send -n 1 luna://com.webos.service.audio/media/getVolume '{}'

Returns:

{

    "returnValue":true,

    "scenario":"media_default",

    "volume":8,

}


media/listScenarios

Description

Get a list of available (enabled/disabled) scenarios.

Parameters

Name

Required

Type

Description

enabledOptionalBoolean
  • To list enabled scenarios, set enabled to true.
  • To hide enabled scenarios, set enabled to false.
  • The default value of enabled is true.
disabledOptionalBoolean
  • To list disabled scenarios, set disabled to true.
  • To hide disabled scenarios, set disabled to false.
  • The default value of disabled is false.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorText" field for details.
errorTextOptionalString

Indicates the reason for the failure of the operation.

scenariosOptionalString array

An array of scenarios.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/listScenarios '{"enabled":true,"disabled":true}'

Returns:
{
    "returnValue": true,
    "scenarios": [
        "media__default"        
    ]
}


media/offsetMicGain

Description

Offset mic gain of the current or specified scenario, by an absolute value or by a number of ticks.

Parameters

Name

Required

Type

Description

offsetRequiredNumber

If unit is percent, set offset in the range [-100, 100].

If unit is step or not specified, set offset in the range [-20, 20]. 

scenarioOptionalString

Scenario to apply the offset. If not specified, the offset is applied to the currently selected scenario.

unitOptionalString

This is used to interpret the offset argument. The value will be one of the followings:

  • step
  • percent

The default value of unit is step.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"Missing 'offset' integer parameter."

Mandatory parameter Offset is missing from input arguments.

3"failed to set parameter (invalid scenario name?)"

Failed to set Offset. Check for Validity of Scenario

3"Invalid 'offset' integer parameter value or file not found."

Offset parameter value is invalid. Check for offset range.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/offsetMicGain '{"offset":12,"unit":"step"}'

Returns:
{
    "returnValue": true
}


media/offsetVolume

Description

Offset volume of the current or specified scenario, by an absolute value or by a number of ticks.

Parameters

Name

Required

Type

Description

unitOptionalString

The manner in which to offset the volume. Possible values are:

  • percent - The percentage by which the volume is increased or decreased.
  • step - The step (in increments of 11) by which the volume is increased or decreased.

Default value : step

Note: Check offset parameter for further details.

offsetRequiredNumber

The offset by which the volume should be increased or decreased.

  • If unit is percent, possible values are in the range of [-100, 100].
    • Scenario:
      Increase volume by 50%
      Values: unit: percent ; offset: 50%

 

  • If unit is step, possible values are in the range of [-20, 20]. 
     
    • Scenario: Increase volume by 2 steps.
      Parameters: unit: step ; offset: 2
      Result: If current volume is 20, the volume will be increased to 20 +11 + 11 = 42
       
    • Scenario: Decrease volume by 3 steps.
      Parameters: unit: step; offset: -3
      Result: If current volume is 42, the volume will be decreased to 42 - 11 - 11 - 11 = 9
       
    • Scenario: Increase volume by 10 steps.
      Parameters: unit: step and offset: 10
      Result: If current volume is 42, the volume is limited to 100 (maximum volume limit).
       
    • Scenario: Decrease volume by 10 steps.
      Parameters: unit: step and offset: -10
      Result: If current volume is 42, the volume is reduced to 0 (minimum volume limit).
scenarioOptionalString

Scenario to apply the offset. If not specified, the offset is applied to the currently selected scenario.

Call Returns

Name

Required

Type

Description

returnValueOptionalBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"Missing 'offset' integer parameter."

Mandatory parameter offset is missing from input arguments.

3"failed to set parameter (invalid scenario name?)"

Failed to set offset. Check for validity of scenario.

3"Invalid 'offset' integer parameter value or file not found."

Offset parameter value is invalid. Check for offset range.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":70,"unit":"percent"}'

{

"returnValue": true

}


media/setCurrentScenario

Description

Designate a scenario as a current scenario.

Parameters

Name

Required

Type

Description

scenarioRequiredString

Scenario to set as the current scenario.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"Missing 'scenario' string parameter."

Mandatory parameter "scenario" is missing from input arguments.

3"Could not set current scenario."

Scenario requested could not be set. Check for Validity of Scenario.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/setCurrentScenario '{"scenario":"media_back_speaker"}'

{

"returnValue": true

}


media/setLatency

Description

Set the latency for each scenario (media).

Parameters

Name

Required

Type

Description

latencyRequiredNumber

Set audio playback latency. This parameter will change the audio playback buffer size in pulseaudio.

scenarioOptionalString

Scenario for which latency is to be set.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"Missing 'latency' integer parameter."

Mandatory Parameter Latency has to be specified

3"failed to set latency (invalid scenario name?)"

Latency for the scenario could not be set. Check for the validity of scenario

3"Invalid 'latency' integer parameter value or file not found."

Latency value is not valid. Latency should be greater than 0

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/setLatency '{"latency":10}'

{

"returnValue": true

}


media/setMicGain

Description

Set mic gain of the current or specified scenario.

Parameters

Name

Required

Type

Description

mic_gainRequiredNumber

Set mic_gain in range [0, 100].

scenarioOptionalString

Scenario for which mic gain is to be set. If not specified, the mic gain is set to the currently selected scenario.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"Missing 'mic_gain' integer parameter."

Mandatory Parameter  mic gain has to be specified

3"failed to set parameter (invalid scenario name?)"

Mic Gain for the scenario could not be set. Check for the validity of scenario

3"Invalid 'mic_gain' integer parameter value or file not found."

Mic Gain value is not valid. It should be  between 0 and 100

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/setMicGain '{"mic_gain":10}'

{

"returnValue": true

}


media/setVolume

Description

Set the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Volume level to be set

scenarioOptionalString

Scenario for which the volume is to be set.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

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

3Invalid 'volume' integer parameter value or file not found.

Volume value is not valid. It should be  between 0 and 100.

Example

luna-send -n 1 -f luna://com.webos.service.audio/media/setVolume '{"volume":10}'

{

"returnValue": true

}


media/status

Description

Get a current state of audiod.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates whether to subscribe for related events.

  • true: Subscribe
  • false: Do not subscribe

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

subscribedOptionalBoolean

Indicates if subscribed to get notified when a connection is closed.

  • true - Subscribed for changes
  • false - Not subscribed
mic_gainOptionalNumber

Mic gain [0 -100] of current or specified scenario.

ringtoneWithVibrationOptionalBoolean

Vibrates along with Ringtone.

scenarioOptionalString

The currently selected scenario.

mutedOptionalBoolean

Indicates whether current module is muted.

hacOptionalBoolean

Indicates hac status. Possible values are:

  • true: hac is enabled
  • false: hac is disabled
volumeOptionalNumber

Current volume [0, 100].

actionOptionalString

Update information. The value will be one of the following:

  • changed
  • enabled
  • disabled
  • requested
ringer switchOptionalBoolean

Ringer switch state. True for on (should ring).

sliderOptionalBoolean

Indicates state of the slider.

  • true: slider is open
  • false: slider is closed
activeOptionalBoolean

Indicates if current module is actively used. Possible values are:

  • true: Actively used.
  • false: Not actively used.

Example

luna-send -i -f luna://com.webos.service.audio/media/status '{"subscribe" : false}'

{

    "mic_gain": 10,

    "returnValue": true,

    "ringtoneWithVibration": true,

    "scenario": "media_back_speaker",

    "muted": false,

    "hac": false,

    "subscribed": false,

    "volume": 10,

    "action": "requested",

    "ringer switch": true,

    "slider": false,

    "active": true

}


ringtone/getVolume

Description

Get the volume level of the current or specified audio scenario. Subscribe to this method to be notified of the volume changes.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean
  • To be notified of the volume changes, set subscribe to true.
  • Otherwise, set subscribe to false.
scenarioOptionalString

Scenario for which to get the volume. If not specified, the volume is retrieved from currently selected scenario.

Subscription Returns

Name

Required

Type

Description

returnValueOptionalBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false. 
actionRequiredString

Update information. The value will be one of the followings:

  • changed
  • enabled
  • disabled
  • requested
changedOptionalString array

Array of properies that has been changed. The value will be one of the followings:

  • scenario
  • volume
  • active
  • muted
  • event
scenarioOptionalString array

Array containg scenarios whose volume has been changed.

volumeOptionalNumber

Current volume [0, 100].

activeOptionalBoolean
  • If current module is actively used, active will contain true.
  • If current module is not actively used, active will contain false.
mutedOptionalString
  • If current module is muted, muted will contain true.
  • If current module is not muted, muted will contain false
eventOptionalString

Broadcast event.

causeOptionalString

The reason why volume is changed. The value will be one of the followings:

  • volumeUp
  • volumeDown
  • setVolume

Example


ringtone/lockVolumeKeys

Description

Lock the volume keys which change the volume of a particular category.

Parameters

None

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example


ringtone/offsetVolume

Description

Increment or decrease the volume of the current or specified scenario, in steps or percent. To increment the volume, pass a positive value. To decrease the value, pass a negative value.

Remark

Volume

  • Range: [0-100]
  • Unit: Percent

In case the unit is percent

New volume = Current volume + (step offset value(%) of maximum_volume_level)
e.g. If current volume = 10, step off set value = 50, maximu_volume_level =100
       New volume = 10 + (50% of 100) = 60

In case the unit is step

New volume = Current volume + (step offset value * 11)
e.g. If current volume = 10, step offset value = 6,
       New volume = 10 + (6 * 11) = 76 

In both cases

  • If the calculated value of the volume is higher than the maximum volume level (i.e. 100), the volume is adjusted to the maximum volume level. 
    e.g. If current volume = 70, offset = 50, unit = percent. Then new volume = 100.
  • If the calculated value of the volume is a negative value, the volume is adjusted to 0.
    e.g. If current volume = 30, offset = -50, unit = percent. Then new volume = 0.

Parameters

Name

Required

Type

Description

offsetRequiredNumber

Offset value to be set to increase or decrease the volume.

  • If unit is percent, set offset in the range [-100, 100].
  • If unit is step or not specified, set offset in the range [-20, 20]. 
scenarioOptionalString

The scenario to apply the volume change to. If not specified, the current scenario gets the volume change.

unitOptionalString

This is used to interpret the offset argument. The value will be one of the followings:

  • step
  • percent

The default value of unit is step.

Example

luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":10,"unit":"percent"}'


ringtone/setMuted

Description

Mute or unmute the master volume.

Parameters

Name

Required

Type

Description

mutedRequiredBoolean
  • To mute the master volume, set muted to true.
  • To unmute the master volume, set muted to false.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example

luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setMuted '{"muted":false}'


state/get

Description

Get the state.

Parameters

Name

Required

Type

Description

nameOptionalString

Parameter name whose status has to be obtained

namesOptionalString array

Array of names for which status has to be obtained

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
forceMicOnOptionalBoolean

Indicates whether mic is enabled or disabled

  • true: mic is enabled
  • false: mic is disabled
adjustMicGainOptionalBoolean

Indicates whether mic gain can be adjusted

  • true: mic gain can be adjusted
  • false: mic gain cannot be adjusted
sliderStateOptionalBoolean

Indicates state of the slider

  • true: slider is open
  • false: slider is closed
displayOnOptionalBoolean

Indicates whether display is on or off

  • true: display is on
  • false: display is off
headsetStateOptionalString

Indicates whether headset is connected or not

  • <None> : No headset connected
  • Headset : headset is connected
  • Headset Mic: headset with mic is connected
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

Error References

Error Code

Error Text

Error Description

2"no setting found"

Mandatory to specify at least one parameter.

Example

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"name" : "all"}'

{

"headsetState": "<None>",

"forceMicOn": false,

"adjustMicGain": false,

"returnValue": true,

"displayOn": false,

"sliderState": false

}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"names" : ["forceMicOn"]}'

{

"forceMicOn": false,

"returnValue": true

}


state/pulse/sinkStatus

Description

List down the status of a pulseaudio sink.

Parameters

Name

Required

Type

Description

sinkOptionalString

Name of sink. If not specified, the status of all the sinks are listed.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

filterOptionalNumber

Pulse filter status.

Note: For webOS Open Source Edition, this parameter is for future use.

sinkOptionalString

Name of the sink.

destinationOptionalString

Physical destination.

volumeOptionalNumber

Current volume set for the sink.

openStreamsOptionalString

Streams opened for the sink.

latencyOptionalNumber

Current latency set for sink.

Note: For webOS Open Source Edition, this parameter is for future use.

Error References

Error Code

Error Text

Error Description

3"Invalid 'sink' string parameter value or file not found."

Invalid 'sink' parameter is provided.

Example

luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/sinkStatus '{"sink" : "pmedia"}'

Returns:
{
    "filter": 0,
    "sink": "pmedia",
    "destination": "pcm_output",
    "volume": 0,
    "openStreams": 0,
    "returnValue": true,
    "latency": 65536
}


state/set

Description

Setter for state.

Remark

  • At least more than one parameter should be passed. Otherwise, the method will fail.

Parameters

Name

Required

Type

Description

adjustMicGainOptionalBoolean

Indicates whether mic gain can be adjusted

  • true: mic gain can be adjusted
  • false: mic gain cannot be adjusted

At least one or both of adjustMicGain and forceMicOn must be passed.

forceMicOnOptionalBoolean

Indicates whether mic can be enabled or disabled

  • true: mic can be enabled
  • false: mic can be disabled

At least one or both of adjustMicGain and forceMicOn must be passed.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails

Example

luna-send -n 1 -f luna://com.webos.service.audio/state/set '{"adjustMicGain" : true}'


system/offsetVolume

Description

Increase or decrease the volume of the current or specified scenario, in steps or percent. To increment the volume, pass a positive value. To decrease the value, pass a negative value.

Remark

Volume

  • Range: [0-100]
  • Unit: Percent

In case the unit is percent

New volume = Current volume + (step offset value(%) of maximum_volume_level)
e.g. If current volume = 10, step off set value = 50, maximu_volume_level =100
       New volume = 10 + (50% of 100) = 60

In case the unit is step

New volume = Current volume + (step offset value * 11)
e.g. If current volume = 10, step offset value = 6,
       New volume = 10 + (6 * 11) = 76 

In both cases

  • If the calculated value of the volume is higher than the maximum volume level (i.e. 100), the volume is adjusted to the maximum volume level. 
    e.g. If current volume = 70, offset = 50, unit = percent. Then new volume = 100.
  • If the calculated value of the volume is a negative value, the volume is adjusted to 0.
    e.g. If current volume = 30, offset = -50, unit = percent. Then new volume = 0.

Parameters

Name

Required

Type

Description

offsetRequiredNumber

Offset value to be set to increase or decrease the volume.

  • If unit is percent, set offset in the range [-100, 100].
  • If unit is step or not specified, set offset in the range [-20, 20]. 
scenarioOptionalString

The scenario to apply the volume change to. If not specified, the current scenario gets the volume change.

unitOptionalString

This is used to interpret the offset argument. The value will be one of the followings:

  • step
  • percent

The default value of unit is "step".

Call Returns

Name

Required

Type

Description

returnValueOptionalBoolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.
errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

Example

luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":70,"unit":"percent"}'


system/setMuted

Description

Mute or unmute the master volume.

Parameters

Name

Required

Type

Description

mutedRequiredBoolean
  • To mute the master volume, set muted to true.
  • To unmute the master volume, set muted to false.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example

luna-send -n 1 -f luna://com.webos.service.audio/system/setMuted '{"muted":false}'


system/status

Description

Get the current status of audiod.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates whether to subscribe for related events.

  • true: Subscribe
  • false: Do not subscribe

Call Returns

Name

Required

Type

Description

returnRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example

luna-send -n 1 -f luna://com.webos.service.audio/system/status '{}'

Returns:
{
    "mic_gain": -1,
    "returnValue": true,
    "scenario": "system_default",
    "muted": false,
    "subscribed": true,
    "volume": 50,
    "action": "requested",
    "active": true
}


systemsounds/playFeedback

Description

Plays various system alert sounds based on the name passed to it.

Parameters

Name

Required

Type

Description

name Optional String

Name of the system sound.

sink Optional String

Sink to use to play sound (default: pfeedback).

play Optional Boolean
  • To preload and play the file, set play to true.
  • To preload but not to play the file, set play to false.
  • The default value of play is true.

Call Returns

Name

Required

Type

Description

returnValue Required Boolean
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false.

Example

luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart", "sink":"pfeedback", "play":true}'


udev/event

Description

Gives 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.

Parameters

Name

Required

Type

Description

eventRequiredString

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 headset-removed, headset-inserted, headset-mic-inserted, usb-mic-inserted,
usb-mic-removed, usb-headset-inserted, usb-headset-removed.

soundcard_noOptionalNumber

sound card number as of now is being extracted from the device path where USB sound card is detected by udev.

device_noOptionalNumber

device number as of now is being extracted from the device path where USB sound card is detected by udev.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

If the method succeeds, returnValue will contain true.
If the method fails, returnValue will contain false. 
The method may fail because of one the error conditions described in the Error Codes Reference of this API.

errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

Example

luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"usb-mic-inserted", "soundcard_no":'1', "device_no":'0'}'
 


state/setSoundProfile

Description

Sets a particular sound profile.

Remark

This method allows an application to set the following profiles:

  • Sound [Only Ringing]
  • Silent [No Ringing and Vibration] (default profile)
  • Vibrate [Only Vibration]
  • Sound + Vibrate [Ringing and Vibration]

Parameters

Name

Required

Type

Description

ringerRequiredString

Specify whether to enable ringing to notify a user.

  • "ON" or "on": enable ringing
  • "OFF" or "off": disable ringing

Default value: OFF

Note: Combination of upper case and lower case in these values (like "On" / "Off" / "oFF") are not supported and treated as errors.

vibrateRequiredString

Specify whether to enable vibration to notify a user.

  • "ON" or "on": enable vibration
  • "OFF" or "off": disable vibration

Note: Combination of upper case and lower case in these values (like "On" or "Off") are not supported and treated as errors.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates whether the execution succeeded.

- true: Success

- false: Failure

errorTextOptionalString

Describes the error. Returned only in case of execution failure.

errorCodeOptionalNumber

Identifies the error. Returned only in case of execution failure

Error References

Error Code

Error Text

Error Description

2profile setting failed: missing parameters ?

Mandatory parameters are missing from input arguments

3profile setting failed: Invalid value for ringer

Invalid value of "ringer". Valid values are "ON" or "on" , "OFF" or "off"

3profile setting failed: Invalid value for vibrate

Invalid value of "vibrate". Valid values are "ON" or "on" , "OFF" or "off"

1Could not validate json message against schema

Invalid number of input parameters against defined schema of the API

1Not a valid json message

Wrong JSON message format

Example

# luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile

'{

    "ringer" : "on",

    "vibrate" : "on"

}'


state/getSoundProfile

Description

Subscribe to this API to get notifications when the sound profile is changed.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe for notifications when a profile is changed. Possible values are:

  • true - Get notifications
  • false - Notifications are not required

Default value: false

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
subscribedOptionalBoolean

Indicates if subscribed to get notified.

  • true - Subscribed for changes
  • false - Not subscribed
SoundProfileOptionalString

Gives the current sound profile.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "Error Codes Reference" section of this method for details.

errorCodeOptionalNumber

The error code for the failed operation.

Subscription Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
SoundProfileOptionalString

Returns the updated sound profile value.

Error References

Error Code

Error Text

Error Description

1Could not validate json message against schema

Invalid number of input parameters against defined schema of the API

1Not a valid json message

Wrong JSON message format

Example

# luna-send -i -f luna://com.webos.service.audio/state/getSoundProfile

'{

    "subscribe": true

}'

Returns:

{

    "subscribed": true,

    "SoundProfile": "Vibrate only",

    "returnValue": true

}

Subscription Return:

{

    "SoundProfile": "Silent",

    "returnValue": true

}


UMI/connect

Description

Establishes connection for the audio resource.

Parameters

Name

Required

Type

Description

outputModeRequiredString

Audio output device. Possible values are:

  • alsa
audioTypeRequiredString

Type of audio stream. Possible values are:

  • umimedia
sinkRequiredString

Audio sink. Possible values are:

  • ALSA
sourceRequiredString

Audio source. Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port.

contextOptionalString

Audio pipeline ID.

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

sourceRequiredString

Audio source. Possible values are:

  • AMIXER
sinkRequiredString

Audio sink. Possible values are:

  • ALSA

Example

luna-send -n 1 luna://com.webos.service.audio/UMI/connect '{"outputMode" : "alsa", "audioType":"umimedia", "sink" : "ALSA", "source": "AMIXER", "sourcePort": 0}'

Result:

{
    "source":"AMIXER",
    "sink":"ALSA",
    "returnValue":true
}


UMI/disconnect

Description

Disconnects the connection. 

Parameters

Name

Required

Type

Description

sinkRequiredString

Audio sink. Possible values are:

  • ALSA
sourceRequiredString

Audio source. Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port.

audioTypeRequiredString

Audio stream type. Possible values are:

  • umimedia
contextOptionalString

Audio pipeline ID. 

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

sourceRequiredString

Audio source.

sinkRequiredString

Audio sink.

Example

luna-send -n 1 luna://com.webos.service.audio/UMI/disconnect '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "audioType":"umimedia"}'

Result:

{
    "source":"AMIXER",
    "sink":"ALSA",
    "returnValue":true
}


UMI/getStatus

Description

Shows the connection status of audio resources. 

Parameters

None

Call Returns

Name

Required

Type

Description

audioRequiredObject array: audio

Audio connection details.

returnValueRequiredBoolean

 Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

luna-send -i luna://com.webos.service.audio/UMI/getStatus '{ }'

Result:

{
    "audio":
    [
        {
            "source":"AMIXER",
            "sink":"ALSA",
            "muted":false,
            "outputMode":"alsa"
        }
    ],
    "returnValue":true
}


UMI/mute

Description

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.

Parameters

Name

Required

Type

Description

sinkRequiredString

Audio sink. Possible values are:

  • ALSA
sourceRequiredString

Audio source. Possible values are:

  • AMIXER
sourcePortRequiredNumber

Audio source port.

muteRequiredBoolean

Indicates if the input volume is to be muted. Possible values are: 

  • true - If the input volume is to be muted.
  • false - If the input volume is not to be muted. 

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details. 
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "mute":true}'

Result:

{
    "returnValue": true
}
 


master/getVolume

Description

Gives the current master volume of the audio output device. 

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

volumeStatusOptionalObject array: VolumeStatus

Volume status of different audio output devices.

Example

luna-send -n 1 luna://com.webos.service.audio/master/getVolume '{}'

Result:

{  
   "volumeStatus":[  
      {  
         "muted":false,
         "volume":99,
         "soundOutput":"alsa"
      }
   ],
   "returnValue":true
}


master/setVolume

Description

Sets the master volume of the audio output device.

Parameters

Name

Required

Type

Description

soundOutputRequiredString

Target sound output device. Possible values are:

  • alsa
volumeRequiredNumber

Volume level to be set. The valid volume range is between 0-100. 

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Current volume level. The volume can range between 0-100.

soundOutputRequiredString

Target sound output device. Possible values are:

  • alsa
returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

errorCodeOptionalNumber

The error code for the failed operation.

Example

luna-send -n 1 luna://com.webos.service.audio/master/setVolume '{"soundOutput":"alsa","volume":100}'

Result:

{  
   "volume":100,
   "returnValue":true,
   "soundOutput":"alsa"
}


master/volumeUp

Description

Increases the master volume of the device. 

Parameters

Name

Required

Type

Description

soundOutputRequiredString

Audio output device. Possible values are:

  • "alsa"

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Current level of volume. The volume can range from 0-100. 

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

soundOutputRequiredString

Audio output device. Possible values are:

  • alsa

Example

luna-send -n 1 luna://com.webos.service.audio/master/volumeUp '{"soundOutput":"alsa"}'

Result:

{  
   "volume":100,
   "returnValue":true,
   "soundOutput":"alsa"
}


master/volumeDown

Description

Reduces the master volume of the device. 

Parameters

Name

Required

Type

Description

soundOutputRequiredString

Audio output device. Possible values are:

  • alsa

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Current level of volume. The volume can range from 0-100.

returnValueRequiredBoolean

Indicates the status of operation. Possible values are: 

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

soundOutputRequiredString

Audio sound output device. Possible values are:

  • alsa 

Example

luna-send -n 1 luna://com.webos.service.audio/master/volumeDown '{"soundOutput":"alsa"}'

Result:

{  
   "volume":99,
   "returnValue":true,
   "soundOutput":"alsa"
}


master/muteVolume

Description

Mutes or unmutes the master volume of the audio output device. 

Parameters

Name

Required

Type

Description

muteRequiredBoolean

Indicates if the master volume is to be muted. Possible values are: 

  • true - If the master volume is to be muted.
  • false - If the master volume is not to be muted. 
soundOutputRequiredString

 Audio output device. Possible values are:

  • alsa

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation. 

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

muteRequiredBoolean

Indicates if the master volume is muted. Possible values are:

  • true - If the master volume is muted. 
  • false - If the master volume is not muted.
soundOutputRequiredString

Audio output device. Possible values are:

  • alsa

Example

luna-send -n 1 luna://com.webos.service.audio/master/muteVolume '{"soundOutput":"alsa","mute":true}'

Result:

{  
   "mute":true,
   "returnValue":true,
   "soundOutput":"alsa"
}


soundSettings/setSoundOut

Description

Sets the audio output device. 

Parameters

Name

Required

Type

Description

soundOutRequiredString

Audio output device. Possible values are:

  • alsa

Call Returns

Name

Required

Type

Description

soundOutRequiredString

Audio output device. Possible values are:

  • alsa
returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
errorCodeOptionalNumber

The error code for the failed operation.

errorTextOptionalString

Indicates the reason for the failure of the operation. See the "API Error Codes Reference" section for details.

Example

luna-send -n 1 -f luna://com.webos.service.audio/soundSettings/setSoundOut '{"soundOut": "alsa"}'

Result:

{
    "soundOut": "alsa",
    "returnValue": true
}


alert/setVolume

Description

Set the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Volume level to be set.

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example

luna-send -n 1 -f luna://com.webos.service.audio/alert/setVolume '{"volume":60}'

Result:

{
    "returnValue": true
}


alert/getVolume

Description

Get the volume level of the current or specified audio scenario

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details.
scenarioRequiredString

Array containg scenarios whose volume has been changed.

volumeRequiredNumber

Current volume [0, 100].

Example

luna-send -n 1 -f luna://com.webos.service.audio/alert/getVolume '{}'

Result:

{
    "scenario": "alert_default",
    "volume": 60,
    "returnValue": true
}


alert/setMuted

Description

Mute or unmute the alert volume

Parameters

Name

Required

Type

Description

mutedRequiredBoolean
  • To mute the master volume, set muted to true.
  • To unmute the master volume, set muted to false.

Call Returns

Name

Required

Type

Description

returnValueRequiredObject: CallReturn

Details of the method success/failure. CallReturn object contains returnValue, errorCode, errorText and Id.

Example

luna-send -n 1 -f luna://com.webos.service.audio/alert/setMuted '{"muted":true}'

Return:

{
    "returnValue": true
}


alert/status

Description

Get the current status of alert module

Parameters

None

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of operation. Possible values are:

  • true - Indicates that the operation was successful.
  • false - Indicates that the operation failed. Check the "errorCode" and "errorText" fields for details
ringtonewithvibrationRequiredBoolean

Vibrates along with Ringtone.

scenarioRequiredString

The currently selected scenario.

mutedRequiredBoolean
  • If current module is muted, muted will contain true.
  • If current module is not muted, muted will contain false
subscribedRequiredBoolean

Indicates if subscribed to get notified when a connection is closed.

  • true - Subscribed for changes
  • false - Not subscribed
hacRequiredBoolean

Indicates hac status. Possible values are:

  • true: hac is enabled
  • false: hac is disabled
volumeRequiredNumber

Current volume [0, 100].

actionRequiredString

Update information. The value will be one of the following:

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Ringer switch state. True for on (should ring).

sliderRequiredBoolean

Indicates state of the slider.

  • true: slider is open
  • false: slider is closed
activeRequiredBoolean

Indicates if current module is actively used. Possible values are:

  • true: Actively used.
  • false: Not actively used.

Example

luna-send -n 1 -f luna://com.webos.service.audio/alert/status '{}'

Result:

{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "alert_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": 80,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}
 


alert/offsetVolume

Description

Increase or decrease the volume of the current or specified scenario, in steps or percent. To increase the volume, pass a positive value. To decrease the value, pass a negative value.

Parameters

Name

Required

Type

Description

scenarioRequiredString

The scenario to apply the volume change to. If not specified, the volume of the current scenario gets updated.

offsetRequiredNumber

Offset value to be set to increase or decrease the volume.

  • If unit is percent, set offset in the range [-100, 100].
  • If unit is step or not specified, set offset in the range [-20, 20]. 
unitRequiredString

This is used to interpret the offset argument. Possible values are:

  • step
  • percent

The default value of unit is step.

Example

luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":10,"unit":"percent"}'

Result:

{
    "returnValue": true
}
 


Objects

CallReturn

Default object returned by methods.

Name

Required

Type

Description

returnValueRequiredString
  • If the method succeeds, returnValue will contain true.
  • If the method fails, returnValue will contain false. 

The method may fail because of one the error conditions described in the Error Codes Reference  of this API.

errorCodeOptionalNumber

errorCode contains the error code if the method fails. The method will return errorCode only if it fails.

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

getCurrentScenarioReturn

Object returned by getCurrentScenario

Name

Required

Type

Description

returnValueRequiredBoolean
  • lag that indicates success/failure of the request.

  • true: Success
  • false: Failure
scenarioOptionalString

Scenario currently selected if no error occurred

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

listScenariosReturn

Object returned by listScenarios

Name

Required

Type

Description

returnValueRequiredBoolean

Flag that indicates success/failure of the request.

  • true: Success
  • false: Failure
scenariosOptionalString array

An array of scenarios

errorTextOptionalString

errorText contains the error text if the method fails. The method will return errorText only if it fails.

audio

Object returned by UMI/getStatus.

 

Name

Required

Type

Description

sourceRequiredString

Audio Source. Possible Values are:

  • AMIXER
sinkRequiredString

Audio Sink. Possible Values are:

  • ALSA
mutedRequiredBoolean

Indicates if the audio is muted. Possible values are:

  • true - If the audio is muted.
  • false - If the audio is not muted.
outputModeRequiredString

Audio output device. Possible values are:

  • ALSA

VolumeStatus

This object will give Volume details of sound out device

Name

Required

Type

Description

mutedRequiredBoolean

Indicates if the audio is muted. Possible values are:

  • true - If the audio is muted.
  • false - If the audio is not muted.
volumeRequiredNumber

Current volume level. Returns a value only if the audio is not muted.

soundOutputRequiredString

Target sound output device. Possible values are:

  • alsa

ERROR REFERENCES

Error Code

Error Text

Error Description

1Could not validate json message against schema

Invalid number of input parameters against defined schema of the method

1Not a valid json message

Wrong JSON message format

3Invalid volume control

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

3Volume limit reached

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

16Audiod internal error

AUDIOD_ERRORCODE_INVALID_MIXER_INSTANCE

17Audiod internal error

AUDIOD_ERRORCODE_FAILED_MIXER_CALL

18Audiod internal error

AUDIOD_ERRORCODE_INVALID_ENVELOPE_INSTANCE

19Audiod internal error

AUDIOD_ERRORCODE_INVALID_AUDIO_TYPE

20Unknown error

AUDIOD_ERRORCODE_UNKNOWN_ERROR

21Invalid parameters

AUDIOD_ERRORCODE_INVALID_PARAMS

22Not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Driver error

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Audio not connected

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Soundout type not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

22Connection not supported

AUDIOD_ERRORCODE_NOT_SUPPORTED

23Invalid schema

AUDIOD_ERRORCODE_INVALID_SCHEMA


Except as noted, this content is licensed under Creative Commons Attribution 4.0 and sample code is licensed under Apache License 2.0.