Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: MiteWiseacreLives! on Wed 19/11/2014 07:21:54

Title: [SOLVED] Music not looping on game restore
Post by: MiteWiseacreLives! on Wed 19/11/2014 07:21:54
I think I'm going to get slammed for this question, but I haven't found any satisfying answers manual, forums, etc..
I'm using AGS 3.3.2, and in order to have different music in each room I've used the following code in room_Load
Code (ags) Select

function room_Load()
{
  aK_short.Stop(); // Stop the previous track
  aN_short.Play(eAudioPriorityHigh, eRepeat); // Start the room specific one
}

I am in debug mode (not sure if it matters) and whenever I restore it will play the correct music but will not repeat, just plays once.
Also are their any good tutorials for most recent music system? lots of irrelevant stuff out there
Title: Re: Music not looping on game restore
Post by: Crimson Wizard on Wed 19/11/2014 08:38:30
Which type of music are you using?

There's a known bug in AGS that WAV does not repeat on restoring the game.
Here's similar question asked just couple of weeks ago:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=51250.0
Title: Re: Music not looping on game restore
Post by: MiteWiseacreLives! on Wed 19/11/2014 09:08:52
OH Crud! I was sure i was working with MP3 but they are all WAV....
Title: Re: Music not looping on game restore
Post by: Crimson Wizard on Wed 19/11/2014 09:10:51
Just use this workaround:
Code (ags) Select

function on_event(EventType event, int data)
{
    if (event == eEventRestoreGame)
    {
        // restart your music here
    }
}
Title: Re: Music not looping on game restore
Post by: MiteWiseacreLives! on Wed 19/11/2014 09:15:47
Your very gracious C Wizard! Thanks, I even read that thread thinking it didn't apply to my case, what a noob :-[