• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows How to identify the end of the musica.ogg

T

Tigas

Guest
Hello, how do I identify the end of the song to finish the game?

Code:
var global.snd = audio_create_stream(global.file);

audio_play_sound(global.snd, 0, false);

///exemple:

if audio_finish_sound(global.snd)
{
game_end()
}
 
R

Robert

Guest
Hmm I am sure there is probably some simple function to check if a song has finished, but I dont see it. You could probably just use this function audio_is_playing and make sure that it's only set to play the audio once, so if you know that you started the song and that it's no longer playing then it must of finished.
 

FrostyCat

Redemption Seeker
I do not know how you can possibly still not get it with Robert showing you the exact function to use.

Create:
Code:
global.snd = audio_create_stream(global.file);
audio_play_sound(global.snd, 0, false);
End Step:
Code:
if (!audio_is_playing(global.snd)) {
  game_end();
}
 
Top