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 / Is there any "weirdness" with "sound playing()=1 command and certain soundcards?

Author
Message
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 03:01 Edited at: 7th May 2011 06:32
Hello,

I am about to release my newest game Last Half of Darkness:Society of the Serpent Moon (theres a demo if anyone wants to try it out)

http://www.lasthalfofdarkness.com/moon

I am in BETA testing phase right now.. and a couple of the beta testers on certain computers have strange results with comments not lining up with voices. (the sound and subtitles are not in sync)

Since I use the sound playing()=0 command before starting the next subtitle with next voice I am "guessing" that certain sound cards do not correctly give the sound playing()=0 or =1 command the right info? or its late or something.

I have over 5 test computers and cannot recreate this error. (and with most other beta testers everything syncs up great)... but some computers have this strange weirdness.


EDIT**********************

OR COULD IT BE SOMETHING DO WITH THE NUMBER OF SOUNDS PLAYING AT SAME TIME

is there limit to the number of sounds you can use?

maybe some sound cards dont like 8 sounds and is causing some sort of weirdness due to that... could that be it?

any ideas?

Thanks
Bill
Daniel wright 2311
User Banned
Posted: 7th May 2011 04:55 Edited at: 7th May 2011 04:56
Why not just use a flag, this way there will be no probems,like

if object collision(1,2)=1 and soundtoplay1=0
play sound 1
soundtoplay1=1
endif

edit:: Im downloading the demo now to try it out.

my signature keeps being erased by a mod So this is my new signature.
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 05:06 Edited at: 7th May 2011 05:11
@Daniel wright 2311 - Thanks for posting and trying out the demo - please let me know if it works ok for you.

But I am not following your code suggestion.

My code checks the "sound playing()=1" code to make sure the sound is currently playing.



Once the sound is finished playing then the subtitles vanish
(this way each line of subtitles are perfectly timed with each .wav file playing)

It works great on most computers - but for some reason (again... just guessing... some computers dont like the soundplaying() code or something because it doesnt work on some computers)

Thanks
Daniel wright 2311
User Banned
Posted: 7th May 2011 05:48 Edited at: 7th May 2011 05:52
I playd the demo and I loved it, im hooked already,lol, to bad I have no funds right not to buy it, I would.

sound playing()=0 then play sound 1 or sound playing()=1 is ok to use to check the sound to dissplay the next text but my only point was to use flags for speed issues. if you do it like this it might fix it.

if sound playing(1)=0 and sound1played=0
play sound 1
displaytext1=1
sound1played=1
endif

if displaytext1=1
set cursor 1,500
print "dont come near me dude"
endif

if sound playing(1)=0 then sound1played=0

my signature keeps being erased by a mod So this is my new signature.
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 06:13
thanks for trying it out... glad you enjoyed it.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th May 2011 11:46
God this is an awesome stuff, developing it on your very own?

As for playing a certain voice sample for the correct period of time, i would suggest not relying on the 'sound playing' command if it causes some unpredictable results.

You can always use the 'timer()' command for that! Just store in an array how long each sample is in milliseconds, and then count the remaining time while playing, and do the desired actions when th time is up.

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th May 2011 13:40
umm... i tried to try the demo out:

'Could not load sound at line 15134'

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 19:13
@Quel- Yes developing on my own.

Thanks for the timer suggestion(it's an idea) however there are hundreds of voices and subtitles in game so I would have to time each .wav.

Quote: "'Could not load sound at line 15134'"


This is the crazy frustrating stuff about PC development... this kind of weirdness.

Please try starting demo again... that happened on someone elses computer and they re-booted and started demo again and that error did not come up.

Thanks
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th May 2011 19:30
I'm very sure there should exist at least one audio player which gives you the length of a file that precisely so you don't have to time it.

BUT, i can think of a quick little helping utility which you could write, since you i guess don't have any problems with it, using the 'sound playing' command. Start each sound one after the other, and have the program time each. Then have it save the bunch of length info into a .DAT file so the game doesn't need to do this all the time. I guess this is a fair alternative, and to be honest i will use this in my own project since somehow i lost interest in the sound playing command seeing your situation.

This reboot story is a bit weird, rather than sitting back saying that 'it was a one time thing', you should look into the code for a forgotten load line or something which like to come in the way every 100th time.

How long is the whole thing? (number of lines i mean)
Are you hardcoding the levels, or you have an editor?

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 19:52 Edited at: 7th May 2011 20:04
Thanks Quel - that's not a bad idea - its definetly one way to do it - I was just kind of hoping for a quicker fix LOL!


Also... I checked that line you got the error on and its...



ofcourse the weirdness is... the file is located in the directory and its only sometimes (for whatever reason) this file wont load.
Actually a reboot isnt even necessary... just trying again - and then it works - weird huh?

What is the best way to prevent this error? how do I "error trap" this- because I dont even think its a "file exist" error situation.



What exactly is happening when it can't load up the sound? Why would it only be sometimes (even though the sound exists in the directory) Is there anyway to error trap this? At least to have some sort of message to let players know to try starting program again.

otherwise they will think the progam doesnt work and uninstall and then contact tech support - (they wont know to try again)


Thanks
Daniel wright 2311
User Banned
Posted: 7th May 2011 20:26
try this with the loaded sound, I to have noticed some sounds not loading in with this error.

set up a flag to ignore the sound all together if there are problems loading it then load it in one more time after the error.

my signature keeps being erased by a mod So this is my new signature.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th May 2011 20:56
Well a tens of thousands lines long stuff sounds horrible to debug for these typical little DarkBASIC silly things, but first i'd start REM-ing out whole modules to see if there is something which somehow WITH that line at 15134, causes the phenomenon... doing all this WHILE you are waiting for a response at the Bug Reports section of this forum, because it is also very possible that there is something not right in there, but without a complaint Bamber won't notice it.

(If you go that far don't forget to indicate the problem with 'sound playing()' as well)

And maybe, isn't there a chance that there are random situations when you load something else into that first sound slot, and when the code tries to load this one, also in the first slot it can't deal with the problem?

I had a giant range of loading problems and errors during my work... the most common for me is that DB doesn't realize that the file the way i typed in doesn't exist and forgets to b*tch about it, so i don't know for hours what is the problem with my code.

My point is that though many times it costed me hours of frustration, at the end it (so far) always ended up being my fault, and very silly typos and all. Though mostly due the fact of poor feedback from the compiler.

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 7th May 2011 22:00 Edited at: 7th May 2011 22:01
Thanks for the suggestions...


However the real screwy thing is... I cannot recreate any of the errors (on any of my 5 test machines) so its very difficult to test or try new things.

ALSO... @Quel - I wanted to ask if you were able to run again and get by that "cannot load sound" error - did it work the next time?

Thanks
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 7th May 2011 23:45
Yepp it started up after a reinstall correctly.

I tried it out first with skipping intro, but it's fine with intro playing as well.

I'm just sad my computer doesn't like ingame video playback, it's not DB's fault, it's always laggy and the sound is messed up.

Use some kind of media hiding technique with the full game because it's incredible how i knew what i had to do after i checked out the media folders the first time i got the error message.

A very nice game overall, I just keep feeling like if you teamed up with an even more talented 3D artist this could be a big hit.

It is very beautiful already, but i have one major complaint: some stuff here and there has strange texture selection or hard jpeg coding feel, but what has got it all is Wendy's clothes. The ugly scaled texture of it with no real material settings, and its hard-cut poly edges makes it so distracting from everything else...

...although i really liked her skirt!

The talking on the phone bit was a little silly how you made it working. I mean it should be object based as well. Why did you decide on image frames?

Sorry for me bringing up all these, this is just the sign how cool the game is and you are at a point where even if you are tired of the dev. process, you really should give it a last energy boost and make it complete.

There are tons of DBP games having "indie" written all over them. This one of yours has indie written just a few little places on it. Why not to eliminate these, and make it official looking?

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
billy777
23
Years of Service
User Offline
Joined: 9th Jan 2003
Location:
Posted: 8th May 2011 00:49
Thanks Quel... I appreciate the feedback. I like the hear any comments or suggestions. You obviously have a good eye for detail.


Sorry that the video playback is laggy... I am using the DarkVideo plugin - no one else mentioned any lagging.

Yes... the pre-rendered scenes with the 3d characters is not my stong point. I tried to get some help in this area - but its hard to find right person on a budget and can get very expensive if hiring someone professional to do this. I just did the best I could - but I see what you are talking about with her sweater.

I did the phone scene prerendered because then I could light it better and the shadows would cast better against the prerendered background image, etc.

There's actually a few prerendered cut scenes throughout the game -so I didnt really see any reason why the phone scene would stand out if I did it that way.

please feel free to send any more comments my way.

Thanks
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 11th May 2011 01:20 Edited at: 11th May 2011 01:22
Sound doesn't work properly unless you are using sync at least once per cycle. If you only use FastSync, some sound functionality won't work properly.

Relevant Thread:
http://forum.thegamecreators.com/?m=forum_view&t=177326&b=1
http://forum.thegamecreators.com/?m=forum_view&t=155084&b=1

Login to post a reply

Server time is: 2026-07-11 02:36:38
Your offset time is: 2026-07-11 02:36:38