Skip to content

ChannelVolume

Narta Xaymar Dirks edited this page Oct 28, 2026 · 6 revisions

Blitz3DBlitzPlusBlitzBasic

ChannelVolume

ChannelVolume:Void channel:Int32, volume:Float32
Parameter Mode Type Default Description
channel In Int32 required A channel handle from PlaySound or PlayMusic.
volume In Float32 required 0 is silence and 1 is the full volume of the sound. Values outside that range are limited to it.

Description

Sets the volume of one channel. It can be changed while the sound plays, for example to fade it out.

Differences

  • A debug build (-d) stops the program when the channel was never given out. A channel that is over is fine everywhere, see Debug handle checks.

Examples

; MakeBeep writes beep.wav, see the LoadSound example for the code.
Local snd = LoadSound("beep.wav")
LoopSound snd
Local ch = PlaySound(snd)
For i = 10 To 0 Step -1
	ChannelVolume ch, i / 10.0
	Delay 150
Next
StopChannel ch

Related Commands

ChannelPan, ChannelPitch, ChannelPlaying, PauseChannel, ResumeChannel, SoundVolume, StopChannel

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally