Sound questions

Blitz3D Forums/Blitz3D Beginners Area/Sound questions

JBR(Posted 2004) [#1]
Hello, I'm having problems using sounds.

I load a 'thrust sound' and when I'm holding the thrust key down I do a Playsound(). with some sounds the thrust plays continuously and others play for too long.
What should I do?

The bullet sound is better, but how do I make it shorter?
I fire a bullet every frame and the sound kind of gets merged too much.

I'm totally new to sounds and would appreciate some help, like where to get sounds & what format & how to play them effectively?

What about stereo sounds?

Thanks
Marg


WolRon(Posted 2004) [#2]
It sounds like your problem is more about how you are playing your sounds then the sounds themselves.

Don't play the bullet sound every frame. That is probably too fast. Do some tests and try playing the sound every other frame or every 3rd or 10th frame, whatever.


VIP3R(Posted 2004) [#3]
Another way is to detect whether the sound is already playing, then only play the sound if it isn't - see the ChannelPlaying command.

There are other commands for controlling the way your sounds play, see ChannelPan and ChannelPitch in your command reference.

Also it would be best looping the thrust sound rather than playing the sound every loop.


Stevie G(Posted 2004) [#4]
For the thrust sound your better getting one which loops, pause channel and resume channel when you want to play it. I've got something if you need it.


JBR(Posted 2004) [#5]
Thanks guys, it's now working.
Marg