3Dsound problems

Blitz3D Forums/Blitz3D Programming/3Dsound problems

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You should be doing:
Graphics3D 640,480
SetBuffer BackBuffer()
camera=CreateCamera()
cube=CreateCube()
PositionEntity cube,0,0,3
CreateListener(camera)
Intro=Load3DSound("ExcuseMe.wav")
LoopSound(Intro)
CH_Sound=EmitSound(Intro,cube)

While Not KeyDown( 1 )
If KeyDown(30) ; A
	StopChannel(CH_Sound) ' *******
	CH_Sound=EmitSound(Intro,cube)
EndIf
If KeyDown(16) ; Q
	StopChannel(CH_Sound)
EndIf
RenderWorld
Flip
Wend
End 

Always use StopChannel() before EnitSound() otherwise a new instance is created.
Also you should be liberally sprinkling your code with ChannelPlaying() queries.