GameMaker: Studio

GameMaker: Studio

View Stats:
*COZ* Pfc315 Oct 3, 2012 @ 9:08pm
Multiple Background Music?
I know how the background music works but is there a way to get it to play one song after another? I tried to set 2 background songs at the same time but the first one just keeps playing any ideas?
< >
Showing 1-3 of 3 comments
Mattchu Oct 4, 2012 @ 3:18pm 
Mix the two together in an audio program like Audacity?

If you're using "audio_play_music", you can only have one running at a time, as described in the help file.

You might be able to play two at once with "audio_play_sound", but seeing as there's a separate function for music, I don't know if it's built to run sound files that large. I also don't know why you wouldn't just mix them with an audio program so that they'd run simultaneously for the intended duration.
terraformer299 Oct 4, 2012 @ 4:19pm 
You can't run two .mp3's simultaneously.
The first one designated will play, and the second will be ignored.

You could either put one after the other in a program like Audacity, as MattchuDeePorkupineh said, or simply run a check to play one song when the other isn't playing.

In the Step event of a controller, put:
if !audio_is_playing(sound1)
audio_play(sound2);

This will check for when your first song isn't playing, and then run it.

Alternatively, set up a queue of songs you want to play, and run them via Alarms.

Create event of a controller:
song1 = sound1;
song2 = sound2;
song3 = sound3;
alarm[0] = 1;

Alarm[0] Event
audio_play(song1,false); //Set to true if you want it to loop
alarm[1] = 10 /* IMPORTANT NOTE! Set the alarm to be the number of seconds he song goes for, or a few extra, and multiply it by the room speed.
alarm[1] = seconds*room_speed
*/

Then repeat, until the final alarm, in which you can make it restart the first alarm to make a loop of sorts.
:)

Hope this helps!


EDIT:
Why does the number zero delete from my post?
:|
Last edited by terraformer299; Oct 4, 2012 @ 4:45pm
*COZ* Pfc315 Oct 4, 2012 @ 4:55pm 
Thanks terraformer thats what I was looking for.
< >
Showing 1-3 of 3 comments
Per page: 15 30 50

Date Posted: Oct 3, 2012 @ 9:08pm
Posts: 3