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; |
Contents
Constants
Name | Value | Description |
MODE_AUDIO_OUTPUT_PCM | 0 | identifier for the PCM audio output mode |
MODE_AUDIO_OUTPUT_DOLBY | 1 | identifier for the DOLBY audio output mode |
MODE_AUDIO_OUTPUT_DTS | 2 | identifier for the DTS audio output mode |
AUDIO_SOUND_TYPE_UP | 1 | identifier for the UP sound |
AUDIO_SOUND_TYPE_DOWN | 2 | identifier for the DOWN sound |
AUDIO_SOUND_TYPE_LEFT | 3 | identifier for the LEFT sound |
AUDIO_SOUND_TYPE_RIGHT | 4 | identifier for the RIGHT sound |
AUDIO_SOUND_TYPE_PAGE_LEFT | 5 | identifier for the PAGE LEFT sound |
AUDIO_SOUND_TYPE_PAGE_RIGHT | 6 | identifier for the PAGE RIGHT sound |
AUDIO_SOUND_TYPE_BACK | 7 | identifier for the BACK sound |
AUDIO_SOUND_TYPE_SELECT | 8 | identifier for the SELECT sound |
AUDIO_SOUND_TYPE_CANCEL | 9 | identifier for the CANCEL sound |
AUDIO_SOUND_TYPE_WARNING | 10 | identifier for the WARNING sound |
AUDIO_SOUND_TYPE_KEYPAD | 11 | identifier for the KEYPAD sound |
AUDIO_SOUND_TYPE_KEYPAD_ENTER | 12 | identifier for the KEYPAD ENTER sound |
AUDIO_SOUND_TYPE_KEYPAD_DEL | 13 | identifier for the KEYPAD DEL sound |
AUDIO_SOUND_TYPE_SMARTCONTROL_MOVE | 14 | identifier for the SMART CONTROL MOVE sound |
AUDIO_SOUND_TYPE_SMARTCONTROL_SELECT | 15 | identifier for the SMART CONTROL SELECT sound |
AUDIO_SOUND_TYPE_MOVE | 16 | identifier for the MOVE sound |
AUDIO_SOUND_TYPE_PREPARING | 17 | identifier 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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
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 Support | Y | |
SDK Constraint | None | |
Example | ||
deviceapis.audiocontrol.setVolumeUp(); |