Skip to content

AddChannelEffect

Narta Xaymar Dirks edited this page Nov 27, 2026 · 1 revision

AddChannelEffect BlitzLLVM

AddChannelEffect:Int32 channel:Int32, type:Int32, position:Int32=-1
Parameter Mode Type Default Description
channel In Int32 required A channel handle from PlaySound, PlayMusic, EmitSound or MovieChannel.
type In Int32 required BB_EFFECT_LOWPASS to BB_EFFECT_LOFI (1 to 12) from the shipped include file audio.bb. 0, which a BB_ name is when audio.bb is not included, is a runtime error, and so is any other number.
position In Int32 -1 Where in the chain it goes: -1 (the default) at the end, 0 before the first effect, and so on. Below -1 is a runtime error.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

Adds an effect to the chain of one channel, such as a low-pass for a sound behind a wall. It takes the same types and parameters as AddAudioEffect, but works on this sound only and ends with it. See Audio effects. This is a BlitzLLVM extension.

Differences

  • The chain runs on the sound after its volume and pitch, before its pan. An echo or reverb on a channel stops with the sound: put the channel on a bus with the effect when the tail should ring out. When the channel ends, its effects still take their commands, which then change nothing, like the commands of a channel that is over. A channel that is over, or no channel (0, when there is no sound device), gives such an effect too.

Examples

Include "<audio.bb>"
ch = EmitSound(engine, ship)
wall = AddChannelEffect(ch, BB_EFFECT_LOWPASS)
; Every frame: muffled while the ship is out of sight.
If EntityVisible(camera, ship) Then cutoff = 20000 Else cutoff = 800
AudioEffectParam wall, BB_EFFECTPARAM_FREQUENCY, cutoff, 150

@return The effect, for AudioEffectParam, AudioEffectBypass and FreeAudioEffect.

Related Commands

AddAudioEffect BlitzLLVM, AudioEffectBypass BlitzLLVM, AudioEffectParam BlitzLLVM, ChannelBus BlitzLLVM, ChannelPan BlitzBasic, ChannelPitch BlitzBasic, ChannelPlaying BlitzBasic, FreeAudioEffect BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally