Creating 1 listener?

Blitz3D Forums/Blitz3D Beginners Area/Creating 1 listener?

I created this a while ago to help me play with the settings of a listener... it might help... you're going to need a sound for it though!

Graphics3D 640,480
MoveMouse 320,240

camera=CreateCamera()
light=CreateLight(2)
PositionEntity light,100,100,100

emitter=CreateCube()

rolloff_factor#=.1
doppler_scale#=10
distance_scale#=.5

listener=CreateListener(camera,rolloff_factor,doppler_scale,distance_scale)
sound=Load3DSound("bim.wav")
sound_play=EmitSound(sound,emitter)

PositionEntity emitter,-10,0,-100

x#=0
cx#=0

Repeat
	
	PositionEntity emitter,0,0,Sin(x)*200
	PositionEntity camera,Float(MouseX()-320)/10,0,0
	
	If Not ChannelPlaying(sound_play) Then sound_play=EmitSound(sound,emitter)
	
	x=x+.1
	If x>359 Then x=0
		
	UpdateWorld
	RenderWorld
	
	Text 0,0,"Distance:"+EntityDistance(camera,emitter)
	Text 0,10,"Fall off:"+falloff_distance
	Flip

Until KeyHit(1)