ID:2072343
 
(See the best response by Maximus_Alex2003.)
So I had a question. Is it possible to place music files into a folder, and have a music player system look for all files in a specified folder and pick from them after a certain increment of time?
It's possible, just depends on a few factors.

What type of audio file is it? mp3, ogg, wmv, etc.

Is the music stored server-side or client-side?

If you can answer those two questions, we would get a better understanding where to guide you.
Well the files would be MIDs and I would like it to be server side so no client would have to have the game files in order for it to work
If you're talking about .midi's, that's fine. BYOND can play those internally. Now are you looking to play a specific list of songs, or do you want the game to play every .midi that's included in the host files and play them one by one?

Easiest method would probably be create an associative list of all the songs, and then play them. Associative because you can number the songs and have them cycle by checking the song number with the list length.
Well I mean my intended purpose is area music.. Say you enter an area and it plays a random song from a folder called "Forest" and the folder has like 12 songs in it
Or even if you could tell me how to create a list of songs and how to pick from a list of files
Best response
Alright, so for the /area you'll want to use Entered() and Exited(). You can assign a list variable for /area that will reference the songs you want. Then using pick() for the list, you'll want to output using sound().

I think it should come around something like this:
area
musical_areas
var
list
background_music[]
Entered(atom/movable/Obj, atom/OldLoc)
if(istype(Obj, /mob))
var/mob/player = Obj
if(player.client)
player << pick(src.background_music)
// Or if you need to set anything special:
// player << sound(pick(src.background_music), repeat, wait, channel, volume)
circus
background_music = list(
'song1.mid',
'song2.mid',
'song3.mid',
'song4.mid',
//etc. etc.
)
grocery_store
background_music = list(
'song1.mid',
'song2.mid',
'song3.mid',
'song4.mid',
//etc. etc.
)
backyard
background_music = list(
'song1.mid',
'song2.mid',
'song3.mid',
'song4.mid',
//etc. etc.
)
forest
background_music = list(
'song1.mid',
'song2.mid',
'song3.mid',
'song4.mid',
//etc. etc.
)


But don't quote me on that. I've been running a high fever the past few days so I'm out of it.
is it possible to add high quality music, like actual music?
Perfect thank you so much.