Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / If Sound Playing(7)=1 code... Not working on all computers (Please HELP - Need Opinions)

Author
Message
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 22nd Jun 2011 02:56 Edited at: 22nd Jun 2011 03:11
I have released my newest game Last Half of Darkness: Society of the Serpent Moon - and sure enough - a few customers have emailed me with tech support issues reguarding sound weirdness.

I rely heavily on the "is sound playing()=0" statement...that way I wait for a sound to finish before starting another sound (for dialog, etc.)

First... let me say I cannot recreate this on any of my test computers and most computers it works fine.

For some reason...on *some* computers... the command "if Sound Playing(7)=1" equals 1 even though the sound has stopped playing. It stays stuck equaling 1 even though no sound is playing. weird huh?

Sound Playing(7)=0 is not registering as Zero when the sound is done playing. (again SOMETIMES its totally random)

I can only guess that "certain computers/audio cards" don't like the way I am clearing things up before starting a new sound?






If no sound is playing - why is sound playing(7)=1

Do I need to clear the sound buffer another way for cleaner code?

I am Baffeled!!!!!

Any suggestions welcomed. Thanks.
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 22nd Jun 2011 17:10
Doe's anyone know if certain soundcards can only handle a certain amount of sounds? - I have 7 sounds.

Is there a certain amount of memory on certain computers for audio? Is there anyway to check the sound memory to see if its running out?

Thanks
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd Jun 2011 17:15
I have had this problem before, it's been a problem for a number of years.

These days, I tend to do my own sound handling, like I have properties for each sound, volume etc, then I load one sound, clone it for however many instances I want, then I use functions to play the sound. With that, I can have a delay, I can even work out when too many identical sounds are playing, and reduce the volume if I want.

So, I suggest keeping your own record, maybe each sound has an end time - work out the length of the sound effect, add that in miliseconds to timer() - then only play sounds if the timer is greater than that stored value. Then, stop each sound before you play it, and forget that the sound playing() command ever existed.

Health, Ammo, and bacon and eggs!
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 22nd Jun 2011 18:53
Oh boy... that not really a good option... since I would have re-write a whole bunch of code. After the game has already been released... But thank you for validating this strange error.

ALSO... where is the link to download the latest and most stable version of DarkBasic Pro?
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 22nd Jun 2011 21:14
I downloaded the free version... just figured I needed to put in my activation code to make it a registered version... so I did but then noticed the version number is 1.071

So that seems weird since I had previously had version 1.074

What is the newest version?
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 22nd Jun 2011 22:29
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 22nd Jun 2011 23:04
Thanks for posting.... I just noticed in the updates this...



So this is an official notice of this issue huh? (But I am using wav files - is it the same thing?)

Login to post a reply

Server time is: 2026-07-10 14:05:32
Your offset time is: 2026-07-10 14:05:32