top

AUDIOCONTROL

This class manipulates Volume with deviceapis.audiocontrol object and is used for manipulating the Audio Device volume or DTV volume.

Add the following line for audiocontrol class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js">/script>

You can declare audiocontrol class like this :

  ex) var audiocontrol= deviceapis.audiocontrol;


Constants

NameValueDescription
MODE_AUDIO_OUTPUT_PCM0identifier for the PCM audio output mode
MODE_AUDIO_OUTPUT_DOLBY1identifier for the DOLBY audio output mode
MODE_AUDIO_OUTPUT_DTS2identifier for the DTS audio output mode
AUDIO_SOUND_TYPE_UP1identifier for the UP sound
AUDIO_SOUND_TYPE_DOWN2identifier for the DOWN sound
AUDIO_SOUND_TYPE_LEFT3identifier for the LEFT sound
AUDIO_SOUND_TYPE_RIGHT4identifier for the RIGHT sound
AUDIO_SOUND_TYPE_PAGE_LEFT5identifier for the PAGE LEFT sound
AUDIO_SOUND_TYPE_PAGE_RIGHT6identifier for the PAGE RIGHT sound
AUDIO_SOUND_TYPE_BACK7identifier for the BACK sound
AUDIO_SOUND_TYPE_SELECT8identifier for the SELECT sound
AUDIO_SOUND_TYPE_CANCEL9identifier for the CANCEL sound
AUDIO_SOUND_TYPE_WARNING10identifier for the WARNING sound
AUDIO_SOUND_TYPE_KEYPAD11identifier for the KEYPAD sound
AUDIO_SOUND_TYPE_KEYPAD_ENTER12identifier for the KEYPAD ENTER sound
AUDIO_SOUND_TYPE_KEYPAD_DEL13identifier for the KEYPAD DEL sound
AUDIO_SOUND_TYPE_SMARTCONTROL_MOVE14identifier for the SMART CONTROL MOVE sound
AUDIO_SOUND_TYPE_SMARTCONTROL_SELECT15identifier for the SMART CONTROL SELECT sound
AUDIO_SOUND_TYPE_MOVE16identifier for the MOVE sound
AUDIO_SOUND_TYPE_PREPARING17identifier for the PREPARING sound

Methods

getMute

Description
Returns the current mute state of the DTV.
Parameters
none
Return■Boolean
  - true : audio is muted
  - false : audio is not muted
Emulator SupportY
SDK ConstraintNone
Example
boolean MuteState = deviceapis.audiocontrol.getMute();

getOutputMode

Description
Returnes the current external audio output mode (PCM, DOLBY, DTS).
Parameters
none
Return■Unsigned short
  - current external audio output mode 
   * MODE_AUDIO_OUTPUT_PCM
   * MODE_AUDIO_OUTPUT_DOLBY
   * MODE_AUDIO_OUTPUT_DTS
Emulator SupportY
SDK ConstraintNone
Example
unsigned short OutputMode = deviceapis.audiocontrol.getOutputMode();

getVolume

Description
Returns the current volume of the DTV System. The range of volume is 0 ~ 100.
Parameters
none
Return■Unsigned short
  - The current volume level.
Emulator SupportY
SDK ConstraintNone
Example
unsigned short Volume = deviceapis.audiocontorl.getVolume();

playSound

Description
plays a specific beep sound.
Parameters
■soundType
  - Unsigned short
  - beep sound type which will be played
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
try {
     webapis.audiocontrol.playSound(webapis.audiocontrol.AUDIO_SOUND_TYPE_UP);

catch (error) {
    console.log(error.name);
 }

setMute

Description
Sets the mute state of the audio device.
Parameters
■mute
  - Boolean
  - true: Sets state as mute, false: Sets state as non-mute
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.audiocontrol.setMute(true);

setVolume

Description
Sets the volume level on DTV system. The rage of volume is 0 ~ 100.
Parameters
■volume
  - Unsigned short 
  - range (0 ~ 100)
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.audiocontrol.setVolume(25);

setVolumeDown

Description
Decreases the volume of the DTV system. The rage of volume is 0 ~ 100.
Parameters
none
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.audiocontrol.setVolumeDown();

setVolumeUp

Description
Increases the volume of the DTV System. The range of volume is 0 ~ 100.
Parameters
none
Return■Void
Emulator SupportY
SDK ConstraintNone
Example
deviceapis.audiocontrol.setVolumeUp();