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.

Newcomers DBPro Corner / i need help please (loading sounds)

Author
Message
zoomuz9
17
Years of Service
User Offline
Joined: 16th Sep 2007
Location:
Posted: 16th Sep 2007 11:42
well i did this code can someone tell me whats wrong with it, im new to db

if mouseclick()=1 then load sound "media/testing.wav",1
Clackersmith
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location:
Posted: 16th Sep 2007 13:34 Edited at: 16th Sep 2007 13:43
The "Load sound" function only loads .wav files so make sure the sound being loaded is .wav format.

OR

I'm guessing that your snippet of code is located somewhere in the main loop in order for your program to register the mouse click. As soon as mouse button 1 is clicked your program will load the sound file, since your program will be looping many MANY times a second and the chances are high that mouse button 1 will not have been released the next time your program runs through the main loop. This will cause your program to give the error "Sound already exists" (or something similar) because index number 1 has already had a sound file assigned to it in the previous loop.

Edit: WindowsKiller's example should help you out with this problem.

That we simply are has allowed this reality we call real from the power of intangibility to pull out of inertness action, chaos and hold it into its form we call matter.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 3rd Oct 2007 00:02
The error may be that the sound file is wrong or not even there.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Oct 2007 09:08
Also, your forward slash (/) should be a backslash (\) as it's a directory path not a URL.

But DB is lenient on slashes for some reason and doesn't seem to mind which you use - so any error you are getting is unrelated to that.

TDK_Man

Login to post a reply

Server time is: 2024-09-27 05:08:27
Your offset time is: 2024-09-27 05:08:27