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

Author
Message
Dr Eggman
3
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 27th Dec 2014 12:53
Greetings, Its is I, Dr.Ivo Eggman!

I am having a Problem Loading Music into
My DarkBasic Game,
The Commands I am using is:

load music "Music Filename",1
loop music 1

But when I Test the Game it Says:

"Runtime Warning at Line 50. Music Could Not Be Loaded"

Is There Anything Im doing Wrong?
(Just so you Know i am using the Music That cam with DarkBasic)
("Journeys.mid" to be Exact)
If Anybody Could Help that would Great,

Thank you!

P.S.
Has anyone seen a Blue Hedgehog around here...?

I Am The EGGMAN!
Latch
12
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Dec 2014 22:23
Hello,

Copy the code below and paste it into an empty program. Since you are trying to run and load a midi file, this program will create a test to see if you are able to play midi files. Basically, this program has a HEX dump of a midi file stored in the data statements. It will read this data and write a midi file to your hard drive then load it back in using LOAD MUSIC.

Give it a few seconds to create the file and load it . If it never starts playing then there may be something wrong with your computer setup. If it does play, then you are probably not identifying the correct path to he file you want to play:

for example : Load Music "C:\Program Files (x86)\Dark Basic Software\Dark Basic\media\music\Fantasy\Journeys.mid",1



Enjoy your day.
Dr Eggman
3
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 28th Dec 2014 08:04
Hello,

I Tested that Program and
I did hear the Music Playing But
Its Still not Working in My Program,

And i Have Tried different Paths to
The Music File But Still Cannot get it to
Load The Music,

Are there Any Other ways to get it to Work?
I could give you The Code To My Game If
That Would Help?

Thank you

I Am The EGGMAN!
Latch
12
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Dec 2014 01:58
One good thing, if the program above played music then midi files will load in DarkBASIC for you.

Here's something, do you have the proper security to access the files in the directory you are trying to load from? Perhaps the install was done as an administrator and you are currently signed on as a user that doesn't have proper access?

Try copying the Journeys.mid file into the same directory that "test_close_enc.mid" was stored in and try to load it from there.

So, if you just open a new program and type:

load music "<path to file>\Jouneys.mid",1
play music 1

where <path to file> is the actual full directory path to the file, what happens?

If you want to post hte area in your code where the problem is occurring, a few lines before and a few lines after, we can take a look at that too.

Enjoy your day.
Dr Eggman
3
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 29th Dec 2014 07:56
I put Journeys.mid where "test_close_enc.mid" and
The Same Music Played not "Journeys.mid"
And I've Tried Putting in the Full Path (If this is what you Mean)



And I've Tried Just like This



So Im Not really sure What else to Do,
Is There Any other commands to Play Music?

Oh and Also, do you Know What File type
A 3D Model Has to be to Put in
A Dark Basic Game?

Thank You

I Am The EGGMAN!
Thats What i Am!
Latch
12
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Dec 2014 20:51 Edited at: 29th Dec 2014 20:56
Try a different midi file. Maybe Journeys.mid is corrupt. Because the test program worked, there shouldn't be anything wrong with the commands to load and play the file. The most likely culprit is either the file itself, or you are somehow not identifying the correct directory where the file lives.

Try this:

Start a new empty program and run it (F5). It should open the command line interface (CLI) - a black screen with a yellow bar and > prompt in the bottom section.

at the '>' , type
a$=get dir$()

press [ENTER]

Then type
print a$

press [ENTER]

At the top of the screen, the full path of your current working directory should print. Memorize or write this path down exactly as it appears.

press [ESC]

Copy your midi file into the directory you just wrote down. This is the current directory DarkBASIC is looking at when it starts. Once your file is copied, in an empty program, copy and paste:



If you have moved the midi file into the correct directory, this program will tell you that it has found the file and prompt you to press the space bar to load it. If it doesn't, then the file is not in the correct directory, or the name of the file referenced in the program is different. Check to make sure they are spelled the same way.

If it finds it, you press SPACE, and it still doesn't load and play, there is something wrong with the file itself.


In answer to your second question, a 3d model should be in Direct X format (.X extension) or you can get away with older 3d studio files (.3ds extension). DarkBASIC Classic is old so the direct x version is 7. This means that for animation, a hierarchical structure is necessary. Bones/skeletal animation cannot be used.

Enjoy your day.
Dr Eggman
3
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 30th Dec 2014 09:45
It Worked! I place the code
you told me to and saw that
Dark Basic was
Looking into the Examples file,
so i copyed the Music into that
File and it worked, Its Finally Playing
The Music.

Thank you very much,

Also, How do you get a Model to be
In The Direct X Format?

Thanks again

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham.. Evil Ham..
Latch
12
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 31st Dec 2014 18:57 Edited at: 31st Dec 2014 19:01
The thing to take away from this (the loading of the midi file) is that you have to manage your directories and references to your media (sound, images, models, etc.). There are several commands to help you do this.

As far as direct x files, there are several programs that will output the direct x file format. There are few to none that export the animation in the correct format for DarkBASIC Classic.

To start, I recommend using Deled CE to create and export your environment or static models. It's pretty easy to use and the direct X export works pretty well (and the program is free).

More advanced and also free and there is a Direct X export plugin that supports the proper animation, is Blender 3d.

Here are a couple of links in these forums that talks a little bit about animating for DBC using blender:

http://forum.thegamecreators.com/?m=forum_view&t=158938&b=10
http://forum.thegamecreators.com/?m=forum_view&t=182513&b=10

and here is a link to the export script for blender:

http://forum.thegamecreators.com/?m=forum_view&t=166987&b=3

Enjoy your day.
Dr Eggman
3
Years of Service
User Offline
Joined: 27th Dec 2014
Location: In The Space Coloney Ark
Posted: 1st Jan 2015 07:35
Okay Thanks

Thank you for Your Help

Ill Be Back, With a New Robot!
That has Super Laser Eyes,
And He'll Feed me Ham! Evil Ham..

Login to post a reply

Server time is: 2018-08-20 21:41:20
Your offset time is: 2018-08-20 21:41:20