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 / Loading Music Problem

Author
Message
Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 15th Nov 2012 00:32
Hello everyone! Yes I am back with another silly question.

I have a problem where I want to load music into my game, but everytime I do it says it cant be found. The mp3 file is in the same folder as the excutable file, I am specifying exactly what folder the file is under and still nothing.

what I do is
"load music (source of file and file name).mp3,1
loop music 1"

but I get an error that it doesnt exist when I put it in the exact place it should be.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 15th Nov 2012 03:47 Edited at: 15th Nov 2012 03:51
Quote: "I am specifying exactly what folder the file is under"


try using "realative" file paths vs literal ones. ie, if the music is in the same folder as the exe, just:

load music "song.mp3", 1

if you had a folder called "GameMusic" inside your project folder (where your exe is) and kept your music files there, then:

load music "GameMusic/song.mp3", 1

Virtual Nomad @ California, USA . DBPro V7.7
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 15th Nov 2012 20:09
Off topic

Quote: "Hello everyone! Yes I am back with another silly question."


No question is silly unless...

Quote: "
PERSON 1- GUYS, WHAT IS THAT HUGE FIREBALL HEADED TOWARDS US? WILL IT HURT?

PERSON 2- RUUUUUUUN!

PERSON 1- SHOULD I RUN?
"




Back on topic... do as Virtual Nomad said

Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 18th Nov 2012 00:27
Sorry everyone :/ but no matter what I do I cant load in music without saying it doesnt exist
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Nov 2012 00:50
err, can you copy the exact code you are using to load the file and paste it here in a code block please... I sense you are doing something wrong...

Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 18th Nov 2012 00:56


Of course my code is huge but the rest is not needed. Here is where the problem lies. I also have it imported into dbpro in the media section.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Nov 2012 01:02



RETURN

nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 18th Nov 2012 21:03
Likely an obvious question but did you check exactly how you spelled it? Go to that folder and copy-paste it to your code, then do the same for the filename.

There is no reason a file shouldn't exist if it does exist (although DBP does throw the wrong exceptions up now and then). Try doing this:

If it fails or produces anything weird, please post exactly what happened. Good luck.

@MrValentine:
Good catch: Return in bold

RP Functions Library v1.0

My signature has not been erased by a mod.
Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 18th Nov 2012 21:38
It gives me a Runtime Error 3504 Music file does not exist. It's really upsetting me.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Nov 2012 21:45
Quote: "Good catch: Return in bold "


Why I have no idea what you are trying to say

But yeah for me to have caught that one out is a little surprising, as I am yet to fiddle with them But I recall from HODBPRO VOL1 I remember seeing RETURN being used, went to check it and I was correct

Quote: "It gives me a Runtime Error 3504 Music file does not exist. It's really upsetting me. "


Can you send us the entire project folder or if it is not deemed ok for public domain access you can send it to one of us in private... [Regarding MP3 file], I suspect it may be faulty... try a if file exists call before trying to load it...

Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 18th Nov 2012 22:21
I tried it as a wav file and it decided to troll me and work. I hate electronics sometimes >>
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Nov 2012 22:22
I had a feeling it was a format issue, hence why I said to check if the file existed...

Glad you got it sorted

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 19th Nov 2012 10:39
Just to emphasize what Virtual said earlier, you should use relative filenames.



TheComet

- The codebase
Silence
12
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 19th Nov 2012 21:44
Thank you. I'll do that next time

Login to post a reply

Server time is: 2024-11-21 18:48:13
Your offset time is: 2024-11-21 18:48:13