com.webos.service.audio

API Summary

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:

  • Master: Controls the master volume of audio output devices.
  • UMI: Handles connections and manages volume for audio resources, when playing audio from applications like YouTube.
  • System: Controls audio policy for DTMF (touch tones), alarm, calendar, and effects.
  • Media: Controls audio policy for media playback.
  • Ringtone: Controls audio policy for ringtones.
  • Alert: Controls audio policy 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

NA

Methods

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 Codes Reference

Error Code

Error Text

Error Description

2Missing event string parameter.

Mandatory parameter event is missing from input arguments.

Example

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

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/media/broadcastEvent '{"event":"test","event2":"test2"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/media/broadcastEvent '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'event' string parameter."
}

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 Codes Reference

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

luna-send -f -n 1 luna://com.webos.service.audio/media/disableScenario '{"scenario":"media_back_speaker"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Could not disable requested scenario."
}

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 Codes Reference

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_back_speaker"}'
{
    "returnValue": true
}

luna-send -n 1 -f luna://com.webos.service.audio/media/enableScenario '{"scenario":"media_back_speakerTest"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'scenario' string parameter value or file not found."
}

luna-send -n 1 -f luna://com.webos.service.audio/media/enableScenario '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'scenario' string parameter."
}

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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/media/getCurrentScenario '{}'
{
    "scenario": "media_back_speaker",
    "returnValue": true
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/media/getCurrentScenario '{"TEST"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Not a valid json message"
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/getLatency '{"scenario": "media_back_speaker"}'
{
    "scenario": "media_back_speaker",
    "returnValue": true,
    "latency": 65536
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getLatency '{"scenario": "media_back_speakedddr"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get latency (invalid scenario name?)"
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getLatency '{"scenarioTest": "media_back_speaker"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/getMicGain '{"scenario": "media_back_speaker"}'
{
    "mic_gain": -1,
    "scenario": "media_back_speaker",
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getMicGain '{"scenario": "Test"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getMicGain '{"scenarioTest": "media_back_speaker"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 -f -n 1 luna://com.webos.service.audio/media/getVolume '{}'
{
    "scenario": "media_back_speaker",
    "volume": 45,
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getVolume '{"scenario":"media_back_speaker"}'
{
    "scenario": "media_back_speaker",
    "volume": 45,
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getVolume '{"scenario":"media"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

luna-send -f -n 1 luna://com.webos.service.audio/media/getVolume '{"scenario1":"media"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 '{}'
{
    "returnValue": true,
    "scenarios": [
        "media_back_speaker"
    ]
}

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

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

luna-send -n 1 -f luna://com.webos.service.audio/media/listScenarios '{"enabled":true,"disabled":false}'
{
    "returnValue": true,
    "scenarios": [
        "media_back_speaker"
    ]
}

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

luna-send -n 1 -f luna://com.webos.service.audio/media/listScenarios '{"test"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Not a valid json message"
}

luna-send -n 1 -f luna://com.webos.service.audio/media/listScenarios '{"enabledTEST":true,"disabled":true}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'offset' integer parameter."
}

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

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

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

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":-50, "unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":50, "unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":100, "unit":"percent"}'
{
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":-100, "unit":"percent"}
'
{
    "returnValue": true
}

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

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":110, "unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":-110, "unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetMicGain '{"offset":110, "unit":"percent","scenario":"ringtone_default"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to set parameter (invalid scenario name?)"
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":70,"unit":"percent"}'
{
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","unit":"percent"}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'offset' integer parameter."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":110,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":-110,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

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

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

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":10}'
{
    "returnValue": true
}

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

luna-send -f -n 1 luna://com.webos.service.audio/media/offsetVolume '{"scenario":"media_back_speaker","offset":-3,"unit":"step"}'
{
    "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 Codes Reference

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
}

luna-send -n 1 -f luna://com.webos.service.audio/media/setCurrentScenario '{"scenario":"media_back_speaker_test"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Could not set current scenario."
}

luna-send -n 1 -f luna://com.webos.service.audio/media/setCurrentScenario '{"scenarido":"media_back_speaker_test"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

luna-send -n 1 -f luna://com.webos.service.audio/media/setCurrentScenario '{"scenario":"media_back_speaker","TEST"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Not a valid json message"
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/setLatency '{"latency":10}'
{
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/setLatency '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'latency' integer parameter."
}

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

luna-send -f -n 1 luna://com.webos.service.audio/media/setLatency '{"scenario":"media_back_speaker"}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'latency' integer parameter."
}

luna-send -f -n 1 luna://com.webos.service.audio/media/setLatency '{"latency":10, "scenario":"media_back_speaker_test"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to set
}

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 Codes Reference

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 -f -n 1 luna://com.webos.service.audio/media/setMicGain '{"mic_gain":10}'
{
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/setMicGain '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'mic_gain' integer parameter."
}

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

luna-send -f -n 1 luna://com.webos.service.audio/media/setMicGain '{"mic_gain":10,"scenario":"media_back_speaker_test"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to set parameter (invalid scenario name?)"
}

luna-send -f -n 1 luna://com.webos.service.audio/media/setMicGain '{"scenario":"media_back_speaker"}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'mic_gain' integer parameter."
}

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.

sessionIdOptionalNumber

Denotes the display/session to which the operation is applicable. Possible values are: 0, 1.

Note: If not provided, the operation is applied to session 0.

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 Codes Reference

Error Code

Error Text

Error Description

1Not a valid json message

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

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

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

Example

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

Response:

{
    "returnValue": true
}

For display 1

# luna-send -f -n 1 luna://com.webos.service.audio/media/setVolume '{"volume":50, "sessionId":0}'

Response:

{   
   "returnValue": true
}

 

For display 2

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

Response:

{   
   "returnValue": true
}

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

Response:

{
    "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 -f -n 1 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
}

luna-send -f -n 1 luna://com.webos.service.audio/media/status '{"subscribe" : true}'
{
    "mic_gain": 10,
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "media_back_speaker",
    "muted": false,
    "hac": false,
    "subscribed": true,
    "volume": 10,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": true
}

luna-send -f -n 1 luna://com.webos.service.audio/media/status '{}'
{
    "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
}

nav/status

Description

Get a 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

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

actionRequiredString

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

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Ringer switch state.

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 -i -f luna://com.webos.service.audio/nav/status '{"subscribe" : true}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "nav_default",
    "muted": false,
    "subscribed": true,
    "hac": false,
    "volume": -1,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}
luna-send -i -f luna://com.webos.service.audio/nav/status '{}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "nav_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": -1,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}
luna-send -i -f luna://com.webos.service.audio/nav/status '{"subscribe" : false}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "nav_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": -1,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

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

luna-send -f -n 1 luna://com.webos.service.audio/ringtone/getVolume '{}'
{
    "scenario": "ringtone_default",
    "volume": 50,
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/ringtone/getVolume '{"scenario":"ringtone_default"}'
{
    "scenario": "ringtone_default",
    "volume": 50,
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/ringtone/getVolume '{"scenario":"TEST"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

luna-send -f -n 1 luna://com.webos.service.audio/ringtone/getVolume '{"scenario":"ringtone_default", "subscribe":true}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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

luna-send -n 1 luna://com.webos.service.audio/ringtone/lockVolumeKeys '{}'
{"returnValue":true}
 

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

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

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":15}'
{
    "returnValue": true
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":-5}'
{
    "returnValue": true
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":-50}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":50}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

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

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

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":-105,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 9:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/offsetVolume '{"scenario":"ringtone_default","offset":105,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

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

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

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

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setMuted '{"mutedd":false}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setMuted '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'muted' boolean parameter."
}

ringtone/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 level is 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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setVolume '{"volume":50}'
{
    "returnValue": true
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setVolume '{"volume":10, "scenario":"ringtone_default"}'
{
    "returnValue": true
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setVolume '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'volume' integer parameter."
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/setVolume '{"volume":10, "scenarioa":"ringtone_default"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

ringtone/status

Description

Get the current status of audiod.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to get notified when the status changes. Possible values are:

  • true - Subscribe for changes.
  • false - Not subscribed.

Default value: false

Call Returns

Name

Required

Type

Description

returnRequiredObject: CallReturn

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

Example

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/status '{"subscribe" : true}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "ringtone_default",
    "muted": false,
    "subscribed": true,
    "hac": false,
    "volume": 10,
    "action": "requested",
    "ringer switch": false,
    "slider": false,
    "active": false
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/status '{"subscribe" : false}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "ringtone_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": 10,
    "action": "requested",
    "ringer switch": false,
    "slider": false,
    "active": false
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/ringtone/status '{}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "ringtone_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": 24,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

state/pulse/suspend

Description

Get the suspend state of Pulse Audio.

Parameters

Name

Required

Type

Description

suspendRequiredBoolean

Indicates whether to suspend all sinks. Possible values are: 

  • true - Suspend all sinks
  • false - Do not suspend all sinks

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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/suspend '{"suspend" : false}'
{
    "returnValue": true
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/suspend '{"suspend" : true}'
{
    "returnValue": true
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/suspend '{"suspend" : true, "sink":"ptts"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}
 

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 Codes Reference

Error Code

Error Text

Error Description

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

Invalid 'sink' parameter is provided.

Example

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/sinkStatus '{"sink" : "pmedia"}'
{
    "filter": 0,
    "sink": "pmedia",
    "destination": "pcm_output",
    "volume": 0,
    "openStreams": 0,
    "returnValue": true,
    "latency": 65536
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/sinkStatus '{"sink" : "ptts"}'
{
    "filter": 0,
    "sink": "ptts",
    "destination": "ptts",
    "volume": 0,
    "openStreams": 0,
    "returnValue": true,
    "latency": 65536
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/sinkStatus '{"sink" : "pttssss"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'sink' string parameter value or file not found."
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/state/pulse/sinkStatus '{}'
{
    "pdefaultapp": {
        "filter": 0,
        "sink": "pdefaultapp",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pmedia": {
        "filter": 0,
        "sink": "pmedia",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pcallertone": {
        "filter": 0,
        "sink": "pcallertone",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "ptimer": {
        "filter": 0,
        "sink": "ptimer",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "returnValue": true,
    "pndk": {
        "filter": 0,
        "sink": "pndk",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "palarm": {
        "filter": 0,
        "sink": "palarm",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pvoip": {
        "filter": 0,
        "sink": "pvoip",
        "volume": -1,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "ptts": {
        "filter": 0,
        "sink": "ptts",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "ptts"
    },
    "palerts": {
        "filter": 0,
        "sink": "palerts",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pvoicerecognition": {
        "filter": 0,
        "sink": "pvoicerecognition",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pvvm": {
        "filter": 0,
        "sink": "pvvm",
        "volume": -1,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pcalendar": {
        "filter": 0,
        "sink": "pcalendar",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pnavigation": {
        "filter": 0,
        "sink": "pnavigation",
        "volume": -1,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pringtones": {
        "filter": 0,
        "sink": "pringtones",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pnetflix": {
        "filter": 0,
        "sink": "pnetflix",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pflash": {
        "filter": 0,
        "sink": "pflash",
        "volume": -1,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pnotifications": {
        "filter": 0,
        "sink": "pnotifications",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "peffects": {
        "filter": 0,
        "sink": "peffects",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pfeedback": {
        "filter": 0,
        "sink": "pfeedback",
        "volume": 80,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pvoicedial": {
        "filter": 0,
        "sink": "pvoicedial",
        "volume": 0,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    },
    "pDTMF": {
        "filter": 0,
        "sink": "pDTMF",
        "volume": 80,
        "openStreams": 0,
        "latency": 65536,
        "destination": "pcm_output"
    }
}
 

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 Codes Reference

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
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"names" : ["forceMicOn", "adjustMicGain"]}'
{
    "forceMicOn": false,
    "adjustMicGain": false,
    "returnValue": true
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"names" : ["forceMicOn", "adjustMicGains"]}'
{
    "forceMicOn": false,
    "returnValue": true
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"names" : ["forceMicOn_", "adjustMicGains"]}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting found"
}

Example 6:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"nameT" : "all"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

Example 7:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{"name" : "all_"}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting found"
}

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting found"
}

state/getPreference

Description

Gets the value of the preferences.

Parameters

Name

Required

Type

Description

nameOptionalString

Name of the preference. 

namesOptionalString array

Array of preferences.

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

Indicates whether the device can vibrate when the ringer switch is ON. Possible values are:

  • true - Device can vibrate
  • false - Device cannot vibrate
VibrateWhenRingerOffOptionalBoolean

Indicates whether the device can vibrate when the ringer switch is OFF. Possible values are: 

  • true - Device can vibrate
  • false - Device cannot vibrate
VoiceCommandSupportWhenSecureLockedOptionalString

Indicates whether voice command is supported when the device is locked. Possible values are: 

  • on - Supported
  • off - Not supported
TextEntryCorrectionHapticPolicyOptionalString

Indicates whether system sounds should be played along with haptic feedback. Possible values are:

  • auto - System sounds will be played if ringer switch is ON. Haptic feedback is provided. 
  • hapticOnly - Only haptic feedback is provided.
  • disabled - Both system sounds playback and haptic feedback will be disabled.
  • soundOnly - Haptic feedback is disabled. System sounds are allowed to play.
BeatsOnForHeadphonesOptionalBoolean

Indicates whether beats for headphones is enabled or disabled. Possible values are:

  • true - Beats enabled 
  • false - Beats disabled
BeatsOnForSpeakersOptionalBoolean

Indicates whether beats for speaker is enabled or disabled. Possible values are:

  • true -  Beats enabled 
  • false - Beats disabled
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

Example 1:

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

 

Response:

{
    "VibrateWhenRingerOn": false,
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/state/getPreference '{"names" : ["RingerOn", "VibrateWhenRingerOn", "BeatsOnForHeadphones"]}'

 

Response:

{
    "VibrateWhenRingerOn": false,
    "RingerOn": true,
    "returnValue": true,
    "BeatsOnForHeadphones": true
}

 

Example 3:

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

 

Response:

{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting found"
}

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

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

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/state/set '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting to change found"
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/state/set '{"adjustMicGain" : true, "forceMicOn":false}'
{
    "returnValue": true
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/state/get '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "no setting found"
}

system/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

returnValueRequiredBoolean
  • 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. Values will be one of the followings:

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

Array of scenarios for the changed event, one for each of 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

In case of volume change, indicates cause of change. The value will be one of the followings:

  • volumeUp
  • volumeDown
  • setVolume

Example

luna-send -n 1 -f luna://com.webos.service.audio/system/getVolume '{}'
{
    "scenario": "system_default",
    "volume": 80,
    "returnValue": true
}

luna-send -n 1 -f luna://com.webos.service.audio/system/getVolume '{"scenario":"system_default"}'
{
    "scenario": "system_default",
    "volume": 80,
    "returnValue": true
}

luna-send -n 1 -f luna://com.webos.service.audio/system/getVolume '{"scenario":"system_defaults"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

luna-send -n 1 -f luna://com.webos.service.audio/system/getVolume '{"scenarioT":"system_defaults"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":10}'
{
    "returnValue": true
}

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

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

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":-150,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":150,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 6:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":15,"unit":"step"}'
{
    "returnValue": true
}

Example 7:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":-15,"unit":"step"}'
{
    "returnValue": true
}

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":-25,"unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 9:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenario":"system_default","offset":25,"unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 10:
luna-send -n 1 -f luna://com.webos.service.audio/system/offsetVolume '{"scenarioTEST":"system_default","offset":25,"unit":"step"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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

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

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

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/system/setMuted '{"mutedd":false}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/system/setMuted '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'muted' boolean parameter."
}

system/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 level is 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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/system/setVolume '{"volume":65}'
{
    "returnValue": true
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/system/setVolume '{"volume":65, "scenario":"system"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to set parameter (invalid scenario name?)"
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/system/setVolume '{"volume":65, "scenario":"system_scenario"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to set parameter (invalid scenario name?)"
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/system/setVolume '{"volume":65, "scenario":"system_default"}'
{
    "returnValue": true
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/system/setVolume '{"volume":65, "scenarioT":"system_default"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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

Example 1:luna-send -n 1 -f luna://com.webos.service.audio/system/status '{}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "system_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": 65,
    "action": "requested",
    "ringer switch": false,
    "slider": false,
    "active": false
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/system/status '{"subscribe" : true}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "system_default",
    "muted": false,
    "subscribed": true,
    "hac": false,
    "volume": 65,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/system/status '{"subscribe" : false}'
{
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "system_default",
    "muted": false,
    "subscribed": false,
    "hac": false,
    "volume": 65,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

systemsounds/playFeedback

Description

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

Parameters

Name

Required

Type

Description

nameOptionalString

Name of the system sound.

sinkOptionalString

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

playOptionalBoolean
  • 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

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

Example

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

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

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

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "voicestart"}'
{
    "returnValue": true
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'name' string parameter."
}

Example 6:
luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"namex": "voicestart"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

Example 7:
luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "shutter"}'
{
    "returnValue": true
}

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/systemsounds/playFeedback '{"name": "shutter_test"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'name' string parameter value or file not found."
}

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'}'
luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"headset-inserted"}'
{"returnValue":true}
luna-send -n 1 luna://com.webos.service.audio/udev/event '{"event":"headset-removed"}'
{"returnValue":true}

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 Codes Reference

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

Example 1:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : "on" }'
{
    "returnValue": true
}

Example 2:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "off", "vibrate" : "on" }'
{
    "returnValue": true
}

Example 3:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "off", "vibrate" : "off" }'
{
    "returnValue": true
}

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : "off" }'
{
    "returnValue": true
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on" }'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'vibrate' string parameter."
}

Example 6:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{"vibrate" : "off" }'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'ringer' string parameter."
}

Example 7:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{}'
{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'ringer' string parameter."
}

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : "on" }'
{
    "returnValue": true
}

Example 9:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : "o" }'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "profile setting failed: Invalid value for vibrate"
}

Example 10:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : on }'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Not a valid json message"
}

Example 11:
luna-send -n 1 -f luna://com.webos.service.audio/state/setSoundProfile '{ "ringer" : "on", "vibrate" : true }'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 Codes Reference

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

Example 1:
luna-send -i -f luna://com.webos.service.audio/state/getSoundProfile '{"subscribe": true}'
{
    "subscribed": true,
    "SoundProfile": "Sound & Vibrate",
    "returnValue": true
}
{
    "SoundProfile": "Sound & Vibrate",
    "returnValue": true
}
{
    "SoundProfile": "Sound",
    "returnValue": true
}
{
    "SoundProfile": "Silent",
    "returnValue": true
}
{
    "SoundProfile": "Vibrate only",
    "returnValue": true
}
{
    "SoundProfile": "Sound & Vibrate",
    "returnValue": true
}

Example 2:
luna-send -i -f luna://com.webos.service.audio/state/getSoundProfile '{"subscribe": false}'
{
    "subscribed": false,
    "SoundProfile": "Sound & Vibrate",
    "returnValue": true
}

Example 3:
luna-send -i -f luna://com.webos.service.audio/state/getSoundProfile '{}'
{
    "subscribed": false,
    "SoundProfile": "Sound & Vibrate",
    "returnValue": true
}

Example 4:
luna-send -i -f luna://com.webos.service.audio/state/getSoundProfile '{"subscribed": false}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}
 

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 -f -n 1 luna://com.webos.service.audio/UMI/connect '{"outputMode" : "alsa", "audioType":"umimedia", "sink" : "ALSA", "source": "AMIXER", "sourcePort": 0}'
{
    "source": "AMIXER",
    "sink": "ALSA",
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{"outputMode" : "alsa", "audioType":"umimedia", "sink" : "ALSA", "source": "AMIXERTEST", "sourcePort": 0}'
{
    "errorCode": 4,
    "returnValue": false,
    "errorText": "Invalid parameters"
}

luna-send -f -n 1 luna://com.webos.service.audio/UMI/connect '{"outputMode" : "alsa", "audioType":"umimedia", "sink" : "ALSA", "source": "AMIXER"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

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 -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "audioType":"umimedia"}'
{
    "source": "AMIXER",
    "sink": "ALSA",
    "returnValue": true
}

luna-send -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "audioType":"umimedia"}'
{
    "errorCode": 200,
    "returnValue": false,
    "errorText": "Audio not connected"
}

luna-send -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

luna-send -f -n 1 luna://com.webos.service.audio/UMI/disconnect '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "audioType":"umimediaTest"}'
{
    "errorCode": 19,
    "returnValue": false,
    "errorText": "Internal error"
}

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 -f -n 1 luna://com.webos.service.audio/UMI/getStatus '{}'
{
    "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}'
{
    "returnValue": true
}

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

luna-send -n 1 -f luna://com.webos.service.audio/UMI/mute '{"sink" : "ALSA", "source": "AMIXER", "sourcePort": 0, "mute":1}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

master/getVolume

Description

Gives the current master volume of the audio output device. 

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Indicates if subscribed to get notifications.

Possible values are:

  • true: Subscribed for notifications
  • false: Not subscribed

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the 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

Indicates the status of volume for different audio output devices.

callerIdOptionalString

Indicates the luna service name of the calling application.

Example

# luna-send -n i -f luna://com.webos.service.audio/master/getVolume '{
   "subscribe":true
}'

Response:

{
   "volumeStatus":{
      "sessionId":0,
      "muted":false,
      "volume":100,
      "soundOutput":"alsa"
   },
   "returnValue":true,
   "callerId":"com.webos.lunasend-2027"
}

After change volume for session 1:

{
   "volumeStatus":{
      "sessionId":1,
      "muted":false,
      "volume":50,
      "soundOutput":"alsa"
   },
   "returnValue":true,
   "callerId":"com.webos.lunasend-2057"
}

master/setVolume

Description

Sets the master volume of the audio output device.

Parameters

Name

Required

Type

Description

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

soundOutputRequiredString

Indicates the target sound output device.

Possible value: "alsa"

volumeRequiredNumber

Indicates the volume level to be set.

Possible range: 0-100 

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current volume level.

Possible range: 0-100

soundOutputRequiredString

Indicates the target sound output device.

Possible value: "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 -f -n 1 luna://com.webos.service.audio/master/setVolume '{
   "soundOutput":"alsa",
   "volume":57,
   "sessionId":0
}'

Response:

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

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

Response:

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

master/volumeUp

Description

Increases the master volume of the device. 

Parameters

Name

Required

Type

Description

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current level of volume.

Possible range: 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

Indicates the audio output device.

Possible value: "alsa" 

Example

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

Response:

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

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

Response:

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

master/volumeDown

Description

Reduces the master volume of the device. 

Parameters

Name

Required

Type

Description

soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to session 0.

Call Returns

Name

Required

Type

Description

volumeRequiredNumber

Indicates the current level of volume.

Possible range: 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

Indicates the audio sound output device.

Possible value: "alsa"

Example

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

Response:

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

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

Response:

{
    "volume": 49,
    "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: Master volume to be muted.
  • false: Master volume not to be muted.
sessionIdOptionalNumber

Indicates the display/session applicable to the operation.

Possible values are:

  • 0
  • 1

Note: If not provided, the operation is applied to the audio device connected to both the displays/sessions.

soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

Call Returns

Name

Required

Type

Description

returnValueRequiredBoolean

Indicates the status of the 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 on mute or not.

Possible values are:

  • true: Master volume is on mute. 
  • false: Master volume is not on mute.
soundOutputRequiredString

Indicates the audio output device.

Possible value: "alsa"

Example

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

Response:

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

# luna-send -f -n 1 luna://com.webos.service.audio/master/muteVolume '{
   "soundOutput":"alsa",
   "mute":false,
   "sessionId":0
}'

Response:

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

# 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"
}

# 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"
}

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

Example:

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

 

Response:

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

 

Example:

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

 

Response:

{
    "errorCode": 10,
    "returnValue": false,
    "errorText": "Not implemented"
}

alert/setVolume

Description

Sets the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Volume level to be set.

scenarioOptionalString

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

Call Returns

Name

Required

Type

Description

ReturnRequiredObject: CallReturn

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

Example

Example 1:

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

 

Response:

{
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/alert/setVolume '{"volume":75, "scenario":"alert_default"}'

 

Response:

{
    "returnValue": true
}

alert/getVolume

Description

Gets the volume level of the current or specified audio scenario. 

Parameters

Name

Required

Type

Description

scenarioOptionalString

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

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

Example 1:

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

 

Response: 

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

 

Example 2:

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

 

Response:

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

alert/setMuted

Description

Mutes or unmutes 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

Example 1:

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

 

Response:

{
    "returnValue": true
}

 

Example 2:

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

 

Response:

{
    "returnValue": true
}

 

Example 3:

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

 

Response:

{  
   "errorCode":2,
   "returnValue":false,
   "errorText":"Missing 'muted' boolean parameter."
}

alert/status

Description

Gets the current status of alert module.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to get notified when the status changes. Possible values are:

  • true - Subscribe for changes.
  • false - Not subscribed.

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
ringtonewithvibrationRequiredBoolean

Vibrates along with Ringtone.

scenarioRequiredString

Scenario that is currently selected. 

mutedRequiredBoolean

Indicates if the current module is muted. Possible values are:

  • true - Muted
  • false - Not muted
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 set. Valid range: 0 - 100

actionRequiredString

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

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Indicates the state of the ringer switch. Possible values are:

  • true - Ringer is ON 
  • false - Ringer is OFF
sliderRequiredBoolean

Indicates the state of the slider. Possible values are: 

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

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

  • true: Actively used
  • false: Not actively used
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

Example 1:

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

 

Response:

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

 

Example 2:

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

 

Response:

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

alert/offsetVolume

Description

Increases or decreases 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

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

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

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

Example 4:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":-150,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 5:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":150,"unit":"percent"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 6:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":15,"unit":"step"}'
{
    "returnValue": true
}

Example 7:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":-15,"unit":"step"}'
{
    "returnValue": true
}

Example 8:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":-25,"unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 9:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenario":"alert_default","offset":25,"unit":"step"}'
{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

Example 10:
luna-send -n 1 -f luna://com.webos.service.audio/alert/offsetVolume '{"scenarioTEST":"alert_default","offset":25,"unit":"step"}'
{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

alarm/setVolume

Description

Sets the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

volumeRequiredNumber

Volume level to be set.

scenarioOptionalString

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

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

Example 1: 

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{"volume":50}'

 

Response: 

{  
   "returnValue":true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{"volume":10, "scenario":"alarm_default"}'

 

Response:

{
    "returnValue": true
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{}'

 

Response:

{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'volume' integer parameter."
}

 

Example 4:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{"volume":10, "scenarioa":"alarm_default"}'

 

Response: 

{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

 

Example 5:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{"volume":500}'

 

Response: 

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'volume' integer parameter value or file not found."
}

 

Example 6:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setVolume '{"volume":-500}'

 

Response: 

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'volume' integer parameter value or file not found."
}

alarm/status

Description

Gets the current status of the alarm module.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to get notified when the status changes. Possible values are:

  • true - Subscribe for changes.
  • false - Not subscribed.

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
ringtonewithvibrationRequiredBoolean

Indicates if the device vibrates along with the ringtone. Possible values are:

  • true - Vibration enabled
  • false - Vibration disabled
scenarioRequiredString

Scenario that is currently selected. 

mutedRequiredBoolean

Indicates if the current module is muted. Possible values are:

  • true - Muted
  • false - Not muted
subscribedRequiredBoolean

Indicates if subscribed to get notified when status changes.

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

Indicates HAC status. Possible values are:

  • true: HAC enabled
  • false: HAC disabled
volumeRequiredNumber

Current volume set. Valid range: 0 - 100

actionRequiredString

Indicates the type of action. Possible values are:

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Indicates the state of the ringer switch. Possible values are:

  • true - Ringer is ON 
  • false - Ringer is OFF
sliderRequiredBoolean

Indicates the state of the slider. Possible values are: 

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

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

  • true: Actively used
  • false: Not actively used
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

Example 1: When subscribe is set to true

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/status '{"subscribe" : true}'

 

Response: 

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

 

Example 2: When subscribe is set to false

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/status '{"subscribe" : false}'

 

Response: 

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

 

Example 3: Using the default value

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

 

Response: 

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

alarm/offsetVolume

Description

Increases or decreases the volume of the current or specified scenario, in steps or percentage. 

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.

unitRequiredString

Used to interpret the offset argument. Possible values are:

  • step
  • percent

Default value: step

offsetRequiredNumber

Offset value 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]. 

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

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/offsetVolume '{"scenario":"alarm_default","offset":10,"unit":"step"}'

 

Response:

{
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/offsetVolume '{"scenario":"alarm_default","offset":-5}'

 

Response:

{
    "returnValue": true
}

 

Example 3:

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

 

Response:

{
    "returnValue": true
}

 

Example 4:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/offsetVolume '{"scenario":"alarm_default","offset":-50}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'offset' integer parameter value or file not found."
}

alarm/getVolume

Description

Gets the volume level of the current or specified audio scenario.

Parameters

Name

Required

Type

Description

scenarioOptionalString

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

Call Returns

Name

Required

Type

Description

scenarioRequiredString

Scenario whose volume has been changed.

volumeRequiredNumber

Current volume [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.

Example

Example 1: When the scenario is not specified

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

 

Response:

{
    "scenario": "alarm_default",
    "volume": 10,
    "returnValue": true
}

 

Example 2: When a scenario is specified

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/getVolume '{"scenario":"alarm_default"}'

 

Response:

{
    "scenario": "alarm_default",
    "volume": 10,
    "returnValue": true
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/getVolume '{"scenario":"alarm"}'

 

Response: 

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

alarm/setMuted

Description

Mute or unmute the alarm 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

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

Example 1:

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

 

Response:

{
    "returnValue": true
}

 

Example 2:

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

 

Response:

{
    "returnValue": true
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/setMuted '{}'

 

Response:

{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'muted' boolean parameter."
}

alarm/getAlarmOn

Description

Returns the value set by the alarm.

Parameters

None

Call Returns

Name

Required

Type

Description

AlarmOnRequiredBoolean

Indicates whether alarm sound is ON or OFF in silent or vibration modes. Possible values are:

  • true - Alarm sound is ON
  • false - Alarm sound is OFF
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

Example:

# luna-send -n 1 -f luna://com.webos.service.audio/alarm/getAlarmOn '{}'

 

Response:

{
    "AlarmOn": true,
    "returnValue": true
}

voiceCommand/status

Description

Get a current scenario of voiceCommand state.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to get notified when the status changes. Possible values are:

  • true - Subscribe for changes.
  • false - Not subscribed.

Default value: false

Call Returns

Name

Required

Type

Description

mic_gainRequiredNumber

Mic gain of current or specified scenario.

Valid range: 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
ringtonewithvibrationRequiredBoolean

Indicates if the device vibrates along with the ringtone. Possible values are:

  • true - Vibration enabled
  • false - Vibration disabled
scenarioRequiredString

Scenario that is currently selected.

mutedRequiredBoolean

Indicates if the current module is muted. Possible values are:

  • true - Muted 
  • false - Not muted
hacRequiredString

Indicates HAC status. Possible values are:

  • true: HAC enabled
  • false: HAC disabled
subscribedRequiredBoolean

Indicates if subscribed to get notified when status changes.

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

Current volume [0, 100].

actionRequiredString

Indicates the type of action. Possible values are:

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Indicates the state of the ringer switch. Possible values are: 

  • true - Ringer is ON
  • false - Ringer is OFF
sliderRequiredBoolean

Indicates the state of the slider. Possible values are:

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

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

  • true: Actively used
  • false: Not actively used

Example

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/status '{"subscribe" : true}'

 

Response:

{
    "mic_gain": 50,
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "voice_command_back_speaker",
    "muted": false,
    "hac": false,
    "subscribed": true,
    "volume": 90,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/status '{"subscribe" : false}'

 

Response:

{
    "mic_gain": 50,
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "voice_command_back_speaker",
    "muted": false,
    "hac": false,
    "subscribed": false,
    "volume": 90,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

 

Example 3:

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

 

Response:

{
    "mic_gain": 50,
    "returnValue": true,
    "ringtonewithvibration": true,
    "scenario": "voice_command_back_speaker",
    "muted": false,
    "hac": false,
    "subscribed": false,
    "volume": 90,
    "action": "requested",
    "ringer switch": true,
    "slider": false,
    "active": false
}

voiceCommand/getVolume

Description

Get the volume level of the current or specified audio scenario

Parameters

Name

Required

Type

Description

scenarioOptionalString

Scenario for which the volume is 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.
scenarioRequiredString

Scenario whose volume has been changed.

volumeRequiredNumber

Current volume ranges between [0, 100].

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

Example 1:

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

 

Response:

{
    "scenario": "voice_command_back_speaker",
    "volume": 90,
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/getVolume '{"scenario":"voice_command_back_speaker"}'

 

Response:

{
    "scenario": "voice_command_back_speaker",
    "volume": 90,
    "returnValue": true
}

voiceCommand/listScenarios

Description

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

Parameters

Name

Required

Type

Description

enabledOptionalBoolean

Indicates whether to list or hide scenarios that are enabled for voice commands. Possible values are:

  • true - Lists enabled scenarios
  • false - Hides enabled scenarios

Default value: true

disabledOptionalBoolean

Indicates whether to list or hide scenarios that are disabled for voice commands. Possible values are:

  • true - Lists disabled scenarios
  • false - Hides disabled scenarios

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.
scenariosOptionalString array

An array of scenarios.

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

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/listScenarios '{}'

 

Response:

{
    "returnValue": true,
    "scenarios": [
        "voice_command_back_speaker"
    ]
}

 


Example 2:

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

 

Response: 

{
    "returnValue": true,
    "scenarios": [
        "voice_command_back_speaker"
    ]
}

voiceCommand/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 "API Error Codes Reference" section for details.

Example

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/setCurrentScenario '{"scenario":"voice_command_back_speaker"}'

 

Response:

{
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/setCurrentScenario '{"scenario":"media__default"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Could not set current scenario."
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/setCurrentScenario '{"scenario":"voice_command_back_speake"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Could not set current scenario."
}

voiceCommand/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 scenario 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
mic_gainRequiredNumber

Mic gain of current or specified scenario.

Valid range: 0 - 100 

scenarioRequiredString

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

Example

Example 1:

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

 

Response:

{  
   "returnValue":true,
   "scenario":"voice_command_back_speaker",
   "mic_gain":50
}

 

Example 2: 

# luna-send -n 1 luna://com.webos.service.audio/voiceCommand/getMicGain '{"scenario":"voice_command_back_speaker"}'

 

Response:

{  
   "returnValue":true,
   "scenario":"voice_command_back_speaker",
   "mic_gain":50
}

 

Example 3: 

# luna-send -n 1 luna://com.webos.service.audio/voiceCommand/getMicGain '{"scenario":"voice_command_back_speake"}'

 

Response:

{  
   "returnValue":false,
   "errorCode":3,
   "errorText":"failed to get parameter (invalid scenario name?)"
}

voiceCommand/getCurrentScenario

Description

Gets the current scenario.

Parameters

None

Call Returns

Name

Required

Type

Description

scenarioRequiredString

Scenario currently selected.

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

Example:

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

 

Response:

{
    "scenario": "voice_command_back_speaker",
    "returnValue": true
}

voiceCommand/enableScenario

Description

Enables a 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 "API Error Codes Reference" section for details.

Example

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/enableScenario '{"scenario":"voice_command_back_speaker"}'

 

Response:

{
    "returnValue": true
}

 

Example 2:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/enableScenario '{}'

 

Response:

{
    "errorCode": 2,
    "returnValue": false,
    "errorText": "Missing 'scenario' string parameter."
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/enableScenario '{"scenario":"voice_command_back_speake"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'scenario' string parameter value or file not found."
}

 

Example 4:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/enableScenario '{"scenario":"alarm_default"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Invalid 'scenario' string parameter value or file not found."
}

voiceCommand/disableScenario

Description

Disables the specified scenario.

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 "API Error Codes Reference" section for details.

Example

Example:

# luna-send -n 1 -f luna://com.webos.service.audio/voiceCommand/disableScenario '{"scenario":"voice_command_back_speaker"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "Could not disable requested scenario."
}

notification/status

Description

Gets the current state of audiod.

Parameters

Name

Required

Type

Description

subscribeOptionalBoolean

Subscribe to get notified when the status changes. Possible values are:

  • true - Subscribe for changes.
  • false - Not subscribed.

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

Indicates if the device vibrates along with the ringtone. Possible values are:

  • true - Vibration enabled
  • false - Vibration disabled
scenarioRequiredString

Scenario that is currently selected. 

mutedRequiredBoolean

Indicates if the current module is muted. Possible values are:

  • true - Muted
  • false - Not muted
subscribedRequiredBoolean

Indicates if subscribed to get notified when status changes.

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

Indicates HAC status. Possible values are:

  • true: HAC enabled
  • false: HAC disabled
volumeRequiredNumber

Current volume [0, 100].

actionRequiredString

Indicates the type of action. Possible values are:

  • changed
  • enabled
  • disabled
  • requested
ringer switchRequiredBoolean

Indicates the state of the ringer switch. Possible values are:

  • true - Ringer is ON
  • false - Ringer is OFF
sliderRequiredBoolean

Indicates the state of the slider. Possible values are:

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

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

  • true: Actively used
  • false: Not actively used

Example

Example 1: 

# luna-send -n 1 -f luna://com.webos.service.audio/notification/status '{"subscribe":true}'

 

Response:

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

 

Example 2: 

# luna-send -n 1 -f luna://com.webos.service.audio/notification/status '{"subscribe":false}'

 

Response:

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

 

Example 3: 

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

 

Response:

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

notification/getVolume

Description

Gets the volume level of the current or specified scenario.

Parameters

Name

Required

Type

Description

scenarioOptionalString

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

Call Returns

Name

Required

Type

Description

scenarioRequiredString

Scenario for which to get the volume.

volumeRequiredNumber

Current volume [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.

Example

Example 1:

# luna-send -n 1 -f luna://com.webos.service.audio/notification/getVolume '{"scenario" : "notification_default"}'

 

Response:

{
    "scenario": "notification_default",
    "volume": 50,
    "returnValue": true
}

 

Example 2:

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

 

Response:

{
    "scenario": "notification_default",
    "volume": 50,
    "returnValue": true
}

 

Example 3:

# luna-send -n 1 -f luna://com.webos.service.audio/notification/getVolume '{"scenario" : "notification_defaultTest"}'

 

Response:

{
    "errorCode": 3,
    "returnValue": false,
    "errorText": "failed to get parameter (invalid scenario name?)"
}

 

Example 4:

# luna-send -n 1 -f luna://com.webos.service.audio/notification/getVolume '{"scenarioTest" : "notification_default"}'

 

Response:

{
    "errorCode": 1,
    "returnValue": false,
    "errorText": "Could not validate json message against schema"
}

state/getVolumeBalance

Description

Gives the current sound balance value (default sound balance is set to zero).

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

Audio balance volume. Valid range: -10 to +10

Example

Example:

# luna-send -n 1 -f luna://com.webos.service.audio/state/getVolumeBalance '{}'

 

Response:

{
    "balanceVolume": 0,
    "returnValue": true
}

state/setRingerSwitch

Description

Sets ringer switch OFF/ON.

Parameters

Name

Required

Type

Description

ringerRequiredBoolean

Indicates whether the ringer switch is ON or OFF. Possible values are:

  • true - Ringer switch ON
  • false - Ringer switch OFF

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

Example:

# luna-send -n 1 -f luna://com.webos.service.audio/state/setRingerSwitch '{"ringer":true}'

 

Response:

{
    "returnValue": true
}

state/getTouchSound

Description

Gets the touch sound status (feedback sound status).

Parameters

None

Call Returns

Name

Required

Type

Description

touchSoundRequiredString

Indicates the status of touch sound. Possible values are: 

  • ON - Touch sound is enabled
  • OFF - Touch sound is disabled
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

Example:

# luna-send -n 1 -f luna://com.webos.service.audio/state/getTouchSound '{}'

 

Response:

{
    "touchSound": "OFF",
    "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

Provides the volume details of the target sound output device.

Name

Required

Type

Description

mutedRequiredBoolean

Indicates if the audio is on mute or not.

Possible values are:

  • true: Audio is on mute.
  • false: Audio is not on mute.
volumeRequiredNumber

Indicates the current volume level. Returns a value only if the audio is not on mute.

soundOutputRequiredString

Indicates the target sound output device.

Possible value: "alsa"

sessionIdRequiredNumber

Indicates the volume status of the targeted display/session.

Possible values are:

  • 0
  • 1

API Error Codes Reference

Error Code

Error Text

Error Description

200Audio not connected

Audio not connected

17Audiod internal error

AUDIOD_ERRORCODE_FAILED_MIXER_CALL

19Audiod internal error

AUDIOD_ERRORCODE_INVALID_AUDIO_TYPE

18Audiod internal error

AUDIOD_ERRORCODE_INVALID_ENVELOPE_INSTANCE

16Audiod internal error

AUDIOD_ERRORCODE_INVALID_MIXER_INSTANCE

21Invalid parameters

AUDIOD_ERRORCODE_INVALID_PARAMS

23Invalid schema

AUDIOD_ERRORCODE_INVALID_SCHEMA

3Invalid volume control

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

3Volume limit reached

AUDIOD_ERRORCODE_NOT_SUPPORT_VOLUME_CHANGE

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

20Unknown error

AUDIOD_ERRORCODE_UNKNOWN_ERROR

1Could not validate json message against schema

Invalid number of input parameters against defined schema of the method

204Volume control is not supported

Volume control is not supported

1Not a valid json message

Wrong JSON message format

Contents