This site permanently moved to
https://droidscript.github.io
. Please update links accordingly.
You are being forwarded automatically in 3...
[stay here]
Back
SetVolume
Hello World
Set the volume of a given volume type as a number between 0 and 1.
app.SetVolume(
stream
,
level
,
options
)
See Also:
GetVolume
Example - Set Volume
click to expand contents
function
OnStart
(
)
{
lay
=
app
.
CreateLayout
(
"linear"
,
"VCenter,FillXY"
)
;
skb
=
app
.
CreateSeekBar
(
1
)
;
skb
.
SetRange
(
1
)
;
skb
.
SetOnChange
(
SetVolume
)
;
lay
.
AddChild
(
skb
)
;
app
.
AddLayout
(
lay
)
;
}
function
SetVolume
(
value
)
{
app
.
SetVolume
(
"Music"
,
value
)
;
app
.
PlaySound
(
"/Sys/Snd/Poing.ogg"
)
;
}
Copy
Copy All
Run
Number:
fraction (0..1)
String:
“Alarm”
or
“
DTMF
”
or
“Music”
or
“Notification”
or
“Ring”
or
“System”
or
“Voicecall”
String:
“ShowUI”
loading