Skip to content

ChannelPitch

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

Blitz3DBlitzPlusBlitzBasic

ChannelPitch

ChannelPitch:Void channel:Int32, pitch:Int32
Parameter Mode Type Default Description
channel In Int32 required A channel handle from PlaySound.
pitch In Int32 required

Description

Changes the speed and the pitch of a channel that is playing or paused. The value is a sampling frequency in hertz: take the frequency of the sound as the middle value, so a 22050 Hz sound that is set to 44100 plays twice as fast and an octave higher.

Differences

  • Changing the pitch also changes the speed, because the sound is resampled. There is no way to keep the speed.
  • 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 f = 11025 To 44100 Step 1000
	ChannelPitch ch, f
	Delay 40
Next
StopChannel ch

Related Commands

ChannelPan, ChannelPlaying, ChannelVolume, PauseChannel, ResumeChannel, SoundPitch, StopChannel

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally