Finding music?

Blitz3D Forums/Blitz3D Programming/Finding music?

elseano(Posted 2004) [#1]
I've been trying to figure this out for a while now, but I can't seem to think of a way of doing it.
Basically, I want my game to be able to open and play user-added music. Eg. you put the file "Music.wav" in the directory "C:\my game\music\", and then when you run "my game.exe", "Music.wav" is playing in the background. Only problem is, without forcing the user to actually rename their favourite track to "Music.wav", blitz won't be able to open it (because it won't know what the music file is called).
Can anyone help me with this?


Neochrome(Posted 2004) [#2]
Is this going to be just one file? thats allowed in that directory?





You will be abe to see whats going on


elseano(Posted 2004) [#3]
Well, multiple files would be good but one file would be ok as well.


Neochrome(Posted 2004) [#4]
i made an edit... see that code

in this case, i made it look only for .mp3


elseano(Posted 2004) [#5]
Thanks, but doesn't seem to be working, probagbly because I'm being stupid (as usual). If I put this in any old directory, and put a .mp3 file in the same directory, will the program recognise it?


Neochrome(Posted 2004) [#6]
Say you have a the program here
c:\mygame\project.exe

and you have music here
c:\mygame\music

and your music files are there

all you need is "music/" and as the path$ that shoud do it


elseano(Posted 2004) [#7]
Ok, thanks :)


_PJ_(Posted 2004) [#8]
There is also a command (I think PlayCDMusic)??? that will play a cd track, so the user could put in their favourite cd