Trouble with sound

Blitz3D Forums/Blitz3D Programming/Trouble with sound

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.

Hello all.

Im having some bother with something that really should not be so hard..

I have a game sound, it needs to be called if an object in the game is destroyed.

So im using the folloing code.
If ChannelPlaying(line_ch6)=1

Else
  line_ch6=PlaySound(line_snd)
  ChannelPitch line_ch6,40000
End If	


The handle line_ch6, is one of 6 variables, and my code is like above but with all 6 channel handles trapped inside that nested if. so if chan 1 is playing check chan 2 and so on.

The thing is Even though im probably never gona play 6 sounds at once before the first stops playing again I still seem to be getting dead air on some object deaths.

For an older project I setup a type array to handle channels, and I thought hay Ill try that here.

But for some reason I can use an array or a type array to handle these 6 sound channels.

I guess im probably doing something wrong, cos I think the logic behind it is sound. so I'm hoping that you fine bunch will point out what im doing wrong.

On that note. has anyone come up with a really good way of handling sound channels. ?