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

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: comma “,” separated: “ShowUI”