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.

Code Snippets / [DBP] Updated media-less sounds! Works with ALL DBP versions now!

Author
Message
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Sep 2007 18:23
This is a modified version of some code written (I think, correct me if I'm wrong) by Ric and Tommy S. It now writes directly to a .wav file, and then loaded, so can be used in any version of DBP (DBC?). Also, this means that you can now load it as a 3d sound if you wish!

The code:


It works exactly the same as before, but has 1 extra parameter called 'soundtype'. Anything other than 0 will make it a 3d sound rather than a normal sound.

Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 9th Sep 2007 21:30
That's pretty much back to how it worked in the beginning - saving the sound out as a wav and loading it back up again. The memblock routine was added by Green Gandalf to improve the speed. But if it works like this for all versions, then that's good. You'll probably need an 'if file exist(name$+".wav")=1 then delete file name$+".wav"' before opening to write the file, as if the file exists already from a previous execution it will not overwrite it.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 9th Sep 2007 22:47
I already added that, but I must have forgotten to update it

Login to post a reply

Server time is: 2024-11-22 18:54:30
Your offset time is: 2024-11-22 18:54:30