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 / Problems with loading sound

Author
Message
ShinyDarkrai
16
Years of Service
User Offline
Joined: 11th Apr 2010
Location: Im Omnipresent
Posted: 21st Apr 2010 07:36
Hi another problem I'm having is loading sounds. This is my code:




The sound is in the sound folder but for some reason, when I run the program it gives me the error "Runtime error 3002 - Could not load sound at line 198" (line 198 is that line btw). Can anybody tell me what I'm doing wrong?
SoftMotion3D
AGK Developer
20
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 21st Apr 2010 09:17
are you sure your in the correct directory?

Maby somewhere in your code it goes into a different folder and does not return to the ruite directory.

you can do a quick test and throw bullet.wav in with the exe and just load sound "bullet.wav",1

Also make sure its spelled exactly or it will fail too

Development & Editting
ShinyDarkrai
16
Years of Service
User Offline
Joined: 11th Apr 2010
Location: Im Omnipresent
Posted: 21st Apr 2010 20:34
Ah, figured it out now. I was in the wrong directory even though I messed around with it and went back from the root directory C:\. I put the project in the folder that I created (My Projects) and DarkPro was trying to read from the Project folder. Thanks for your hep . Btw I was wondering, how do you "throw" bullet.wav in with the exe? (Soz I'm kind of new to Darkbasic programming)
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Apr 2010 22:21
Quote: "Btw I was wondering, how do you "throw" bullet.wav in with the exe?"


I was wondering about that too - although I should know by now ...

Quote: "(Soz I'm kind of new to Darkbasic programming)"


No need to apologise - we all had to start somewhere.
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 22nd Apr 2010 00:53
Quote: "I was wondering about that too - although I should know by now ..."


I think he means in the same folder, not sure though.

Rawwrr. Sig Fail.

The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 22nd Apr 2010 23:43
By "throw" I'm assuming you mean add it so if you send the exe off to someone else they have the proper file to load? If so, I believe that DBP has options to include the files in a pack of some sort, and another is as an installable exe. Look into these. I have not gotten to that stage YET so, i'm not sure either, but really would like to know if this is the way or not.

www.myspace.com/norseblod
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Apr 2010 17:27 Edited at: 23rd Apr 2010 17:34
Depends on the IDE you are using.

In the newer Synergy editor, you first go to the Media button (2nd along) in the bottom left corner of the IDE and add the media files to the project.

Next, you go to the Properties button (4th button) and change the Application setting from 'exe' to 'media'.

When you compile, all the media files you told it to include will be embedded in the resulting exe file.

If you create a folder called 'Media' in your project folder and copy all your images, models and sounds etc. into it, you can set the IDE to include 'Media\*.*'. That way, if you add more files later, you don't have to add or change anything in the project settings - just compile your program and it will include all the new files.

TDK

Login to post a reply

Server time is: 2026-07-27 20:18:19
Your offset time is: 2026-07-27 20:18:19