This namespace provides access to the audio management, like setting music stream volume.
- Since:
- Version 1.3 (API level 4)
Classes
Members
-
static, readonly alarmVolume :number
-
The current alarm volume, from 0 to 1.
- Since:
- Version 1.3 (API level 4)
-
static, readonly musicVolume :number
-
The current music stream volume, from 0 to 1.
- Since:
- Version 1.3 (API level 4)
-
static, readonly notificationVolume :number
-
The current notification volume, from 0 to 1.
- Since:
- Version 1.3 (API level 4)
Example
mobicontrol.log.info('Current notification volume is ' + mobicontrol.audio.notificationVolume);
-
static, readonly ringVolume :number
-
The current ring volume, from 0 to 1.
- Since:
- Version 1.3 (API level 4)
-
static, readonly SetVolumeStatusCode :object
-
This enumeration represents an error status code of mobicontrol.audio.SetVolumeError.
Properties:
Name Type Description UNKNOWN
object The exact error could not be determined. DO_NOT_DISTURB_MODE
object The volume cannot be set because it would toggle Do Not Disturb mode. - Since:
- Version 1.3 (API level 4)
-
static, readonly voiceCallVolume :number
-
The current voice call volume, from 0 to 1.
- Since:
- Version 1.3 (API level 4)
Methods
-
static setAlarmVolume(volume)
-
Set alarm stream volume.
Parameters:
Name Type Description volume
number Alarm stream volume, must be a number from 0 to 1. Throws:
- Since:
- Version 1.3 (API level 4)
-
static setMusicVolume(volume)
-
Set music stream volume.
Parameters:
Name Type Description volume
number Music stream volume, must be a number from 0 to 1. Throws:
- Since:
- Version 1.3 (API level 4)
Example
mobicontrol.audio.setMusicVolume(0.8);
-
static setNotificationVolume(volume)
-
Set notification stream volume.
Parameters:
Name Type Description volume
number Notification stream volume, must be a number from 0 to 1. Throws:
- Since:
- Version 1.3 (API level 4)
-
static setRingVolume(volume)
-
Set ring stream volume.
Parameters:
Name Type Description volume
number Ring stream volume, must be a number from 0 to 1. Throws:
- Since:
- Version 1.3 (API level 4)
-
static setVoiceCallVolume(volume)
-
Set voice call stream volume.
Parameters:
Name Type Description volume
number Voice call stream volume, must be a number from 0 to 1. Throws:
- Since:
- Version 1.3 (API level 4)