pausechannel command

Blitz3D Forums/Blitz3D Beginners Area/pausechannel command

seferey(Posted 2006) [#1]
When using pausechannel command what can U use for a handle


mindstorms(Posted 2006) [#2]
The variable that you set to the playsound(sound) command:


sound = loadsound("sound.wav")

sound_playing = playsound(sound)

pausechannel(sound_playing)




seferey(Posted 2006) [#3]
I understand your stuff above. But it's when I use like this

;Play some sound please :)

CreateListener(Camera,box,1,1) 

StartEngine=LoadSound("somethings moving.ogg")
StartChannel = EmitSound(StartEngine,box)

MotorRunning=LoadSound("space bar.ogg")
IdleChannel = EmitSound(MotorRunning,box)
PauseChannel IdleChannel 

ResumeChannel IdleChannel 

;End of Sound Setup


it plays both sound which cool but I'm trying to tell it to wait for this sound to finish then play the next one
what command do I use to do this


puki(Posted 2006) [#4]
http://www.blitzbasic.com/b3ddocs/command.php?name=ChannelPlaying&ref=2d_cat


seferey(Posted 2006) [#5]
Thank u for showing me that example I understand that better but can use this setup u show me more than once puki


mindstorms(Posted 2006) [#6]
I think this should do it:
;Play some sound please :)

CreateListener(Camera,box,1,1) 

StartEngine=LoadSound("somethings moving.ogg")
MotorRunning=LoadSound("space bar.ogg")

StartChannel = EmitSound(StartEngine,box)

repeat
if channelplaying(StartChannel) = false then IdleChannel = emitsound(MotorRunning,box)
until keydown(1)

;End of Sound Setup


This will allow you to do other things while the sound is "starting".

;Play some sound please :)

CreateListener(Camera,box,1,1) 

StartEngine=LoadSound("somethings moving.ogg")
MotorRunning=LoadSound("space bar.ogg")

StartChannel = EmitSound(StartEngine,box)

repeat
until channelplaying(startChannel) = false
IdleChannel = emitsound(MotorRunning,box)
;End of Sound Setup


This will lfreeze program execution until idle channel starts.


seferey(Posted 2006) [#7]
Thanks guys