media.setSoundVolume()

Type Function
Library media.*
Return value none
Revision Release 2022.3683
Keywords media, sound, volume, audio
See also media.playSound()
media.getSoundVolume()

Overview

Adjusts the playback volume of an extended sound (media.playSound()). This setting can be adjusted at any time before or during the extended sound playback.

Gotchas

Setting the global volume is a different feature and is not currently supported. Also note that event sounds (media.playEventSound()) do not have volume control. This is a limitation of the event sound API.

Syntax

media.setSoundVolume( volume )
volume (required)

Number. This parameter controls the volume. Values must be in the range from 0.0 (muted) to 1.0 (loudest).

Example

media.setSoundVolume( 0.5 )
print( "volume = " .. media.getSoundVolume() )