Can 3dsound command work with a findchild

Blitz3D Forums/Blitz3D Programming/Can 3dsound command work with a findchild

nrasool(Posted 2005) [#1]
Hi there

I have had a level created for me, and it is a village level, and i have got a lake in there. I have used the findchild to get the lake name and make it an entity. I wanted to use the load3dsound sound command, so when the camera is near it, you can hear the water.

I thought about doing the following

water=FindChild (part1, "water" )
EntityAlpha water,.7
CreateListener(camera)
sound=Load3DSound("lake.ogg") : If Not sound Then RuntimeError "Alert"
LoopSound sound
ch_sound=EmitSound(sound,water)


This is in the beginning of the program, and in the while loop, i haven't added anything in there. Can you use a load3dsound with a findchild entity?

Kind Regards


John Blackledge(Posted 2005) [#2]
I haven't done this before, but there shouldn't be a problem.

You might want to think about switching it on/off at a certain distance though, to free up the channel for other sounds.


nrasool(Posted 2005) [#3]
Hi John

Thanks, i thought it wouldn't be a problem, but i have tested it and it doesn't seem to work. If i create a cube and attach the sound to the cube it works fine.

Your right about a certain distance, that on my list to do. :)

Can anyone else test this please? If it is happening on someone else, then it would seem this is a bug

Kind Regards
Nadeem


Yan(Posted 2005) [#4]
That should work.

Remember that the sound will be emitted from the origin of the entity. If the entity is large, the sound may be 'out of range' unless you are near the origin, depending on the Listeners roll-off, Doppler and scaling settings.

You might want to think about switching it on/off at a certain distance though, to free up the channel for other sounds.
Although, you have got 1024 of em to play with. ;o)


nrasool(Posted 2005) [#5]
Remember that the sound will be emitted from the origin of the entity. If the entity is large, the sound may be 'out of range' unless you are near the origin, depending on the Listeners roll-off, Doppler and scaling settings.


ahh i forgot about that. Will try some testing to see


John Blackledge(Posted 2005) [#6]
Yeah, I just checked. This is a setting I have used in the past:
microphone=CreateListener(camera, 0.5,20)
so I could hear cars coming from a fair distance.

The trouble is that there are no clear instuctions in the manual about what the defaults actually represent.


LAB[au](Posted 2005) [#7]
1024 3D sounds is very optimistic, 1024 decoding buffers (mono not 3D enabled) you have ... on the latest creative xfi you have 128 3d sounds buffers minus as much speakers as you are using as speaker config, so for a quad speaker config, this leaves you 124 simultaneous 3D sound to play with, on audigy 60, on soundblaster live 28 (as on most soundcards) and on certain soundcards 0. Sometimes channels are played on the cpu (when no 3D hardware channels have been found), but this is the worst case scenario.