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 Discussion / Help loading music from folders

Author
Message
g 0 t H F r 3 a K
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: USA
Posted: 6th Oct 2004 08:41
No matter how I code it I get this error when compiling: "Music could not be loaded". I am trying to load music by searching the music folder for mp3's, then loading whatever is found to the system for playing, can anyone help?



AMD Athlon XP 2700 (2.17GHz @ 333FSB) 1GB DDR333 RAM & 256MB ATI Radeon 9600 & 2x120GB HDDs one EIDE 133 and one SATA 150 on Gigabyte 7VT600 with MS Windows XP Pro
D I G I T A L
21
Years of Service
User Offline
Joined: 22nd Jun 2003
Location: Dubai, UAE
Posted: 6th Oct 2004 16:00
well probably its becoz DB dosnt support MP3 music. try loading .wav

g 0 t H F r 3 a K
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: USA
Posted: 7th Oct 2004 03:11
nah, i tried WAV already, besides, a 5 MB MP3 is like a 50 MB WAV and it says here that it supports them:

http://darkbasic.thegamecreators.com/?f=features

but i really can't figure this out still so if anyone can help ...

AMD Athlon XP 2700 (2.17GHz @ 333FSB) 1GB DDR333 RAM & 256MB ATI Radeon 9600 & 2x120GB HDDs one EIDE 133 and one SATA 150 on Gigabyte 7VT600 with MS Windows XP Pro
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 7th Oct 2004 03:25 Edited at: 7th Oct 2004 03:52
Here's something I made a while back. You should be able to edit it a little, then place it in any folder with mp3's in it, and run it to hear the sound/music



hope that helps some

/edit looking at your code, i think you need to put make it +".mp3" on the line that loads the music

/edit whilst eating, i realized that the above statement is absolutely and totally wrong. I must have misconstrued your coding with my coding, or something.

something
PoHa!84
21
Years of Service
User Offline
Joined: 2nd Oct 2003
Location: To your left.
Posted: 7th Oct 2004 04:02
Alright, after looking at your code, I think I have the answer for you. In my code that I posted, you'll notice this line:

if right$(name$,4)=".mid"

with an else case that prints that the file wasn't a .mid... If you run my code in a folder that has midi and only midi files, (at least it did this to me) it will run through three times, returning that ". was not a .mid" ".. was not a .mid" and "... was not a .mid"

just put a check in your code to make sure that the file is an mp3 file, and you'll be good to go!

something
g 0 t H F r 3 a K
20
Years of Service
User Offline
Joined: 19th Sep 2004
Location: USA
Posted: 9th Oct 2004 04:22
thanx PoHa!84,

you might also want to peek this thread (bad of me to have two threads for the same issue, i know)
http://forum.thegamecreators.com/?m=forum_view&t=40307&b=7

and i copied your snippet but i won't get to work on this until i finish the hardwares file and handler, but the code looks good and with the replies i've gotten about this issue i'm sure i'll be able to work it out soon happy

AMD Athlon XP 2700 (2.17GHz @ 333FSB) 1GB DDR333 RAM & 256MB ATI Radeon 9600 & 2x120GB HDDs one EIDE 133 and one SATA 150 on Gigabyte 7VT600 with MS Windows XP Pro

Login to post a reply

Server time is: 2025-05-24 16:43:53
Your offset time is: 2025-05-24 16:43:53