EmitSound problem

Blitz3D Forums/Blitz3D Beginners Area/EmitSound problem

David(Posted 2004) [#1]
i have a problem with sound3d, the sound only ear near in center of entity, if a entity is very big, no sound


Rob Farley(Posted 2004) [#2]
This is how the 3d sounds work, the emit sound comes from the pivot point of the entity.

It sounds like you've got to play with your listener settings, they're pretty twitchy and all dependant on the scale of your world.

Here's an example to help you play with the settings:

Replace the bim.wav with a wav of your own.

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

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)