Skip to content

ChannelPlaying

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

Blitz3DBlitzPlusBlitzBasic

ChannelPlaying

ChannelPlaying:Int32 channel:Int32
Parameter Mode Type Default Description
channel In Int32 required A channel handle from PlaySound or PlayMusic.

Returns: 1 if the channel is playing or paused, otherwise 0.

Description

Tells whether a channel is still playing. A paused channel counts as playing, and a channel that has ended or was stopped does not.

Differences

  • A handle of 0, which the play commands give when there is no sound device or the sound failed to load, is never playing.
  • 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.
Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local snd = LoadSound("beep.wav")
Local ch = PlaySound(snd)
While ChannelPlaying(ch) And Not KeyHit(1)
	Cls
	Text 10, 10, "Playing..."
	Flip
Wend
Cls
Text 10, 10, "Finished"
Flip
Delay 500

Related Commands

ChannelPan, ChannelPitch, ChannelVolume, PauseChannel, ResumeChannel, StopChannel

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally