Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: dcalap on Sun 20/10/2019 11:54:15

Title: Audio stops when a couple of seconds pass
Post by: dcalap on Sun 20/10/2019 11:54:15
Hi,

I'm pretty new with AGS (using 3.4.3.1 version) but I haven't seen any solution in forum and in the Help of AGS.

I've imported a midi song in Music section and it's correctly imported because I can press play and it starts the song and sounds complete without problems. The lenght is correct etc.:

I have this script in a room:

Code (ags) Select

function room_FirstLoad() {
   
    Wait(5);
    cChar1.FaceDirection(eDirectionUp);
    Wait(5);
    aPianoMan.Play();
}


When the player enters the room the music starts but after a couple of seconds stops.

Any idea why this can happen?
Title: Re: Audio stops when a couple of seconds pass
Post by: Slasher on Sun 20/10/2019 11:57:09
How long is the piece?

And where did you place it... Music / Sound folder?
Title: Re: Audio stops when a couple of seconds pass
Post by: dcalap on Sun 20/10/2019 12:01:04
Is 5:33 and I've place it in Music folder. I've used other musics and same happens, just a couple of seconds and stops.
Title: Re: Audio stops when a couple of seconds pass
Post by: dcalap on Sun 20/10/2019 12:39:01
I think I got it, I was using a template that was using music,  I think something is wrong with this stuff, I'll investigate deeply why is happening but the fix is just to execute:


StopMusic();

before starting my song and works properly.

Thanks! :)
Title: Re: Audio stops when a couple of seconds pass
Post by: Slasher on Sun 20/10/2019 16:50:30
What version of ags are you using?