Music continuing in every room without skip [solved]

Started by Skele, Thu 11/05/2017 20:33:29

Previous topic - Next topic

Skele

Hello everybody,

I'm new to Adventure Game Studio, and I'm making a little something for college, and I have one piece of music (named aMusic1) and mp3 file,
which I already imported into the Music folder.
Now my question is, how can I make the music play in every room, and in the transitions between without starting anew?
I found
Code: ags
function room_AfterFadeIn()
{

aMusic1.Play();

}

and added that to the room script, but everytime the player changes rooms the music gets a skip in it and then continues
playing normaly.

The last sound that played before the player changes room, kind of repeats and then continues normally.
(Example: if the music goes La Li Lo Lum, and the player changes rooms while the Lo is playing, the Lo repeats in a skip and then conitnues with Lum etc.)
Is there any way to make the music to continue playing normaly even while changing rooms?

The other room has nothing in its script yet btw.

Also hello to everybody, this site seems very nice :)

Khris

Hi Skele,

this is unfortunately a known issue.
Here's the most current info/workaround I could find: click

Skele

Quote from: Khris on Thu 11/05/2017 21:48:02
Hi Skele,

this is unfortunately a known issue.
Here's the most current info/workaround I could find: click

Oh, thank you!
I will try whats written in the tread you send me.

Snarky

Just to be clear: once you've started playing the music, you don't need to make any more function calls to keep it playing as you change rooms. As long as you don't play anything else, it should just continue. What you should definitely not do is to put a call to start the music in the room_Afterfadein() of each room, since that will restart it from the beginning every time.

As Khris says, the music glitching when you change rooms is an old AGS bug (what happens is that the engine is so busy loading the next room that it doesn't have time to load the next snippet of music into memory, so it just plays the current snippet over and over).

The first thing to check is that the graphics driver is set to Direct3D in winsetup, as this usually fixes it (and since Crimson Wizard has recently fixed the problems that D3D used to have). Or perhaps even the OpenGL driver from the very latest test build.

If that's not enough, try setting room transitions to instant. (If you absolutely want the fade to black, there are other ways to do it.) And then, as pointed out in the other thread, try changing the audio format of the music.

If none of these things work, there's an experimental AGS build where the audio runs in a separate thread, so it doesn't have to wait while you're loading a room. The drawback is that the audio can get out of sync with the game, but if you're not trying to sync music or speech exactly with animation, that doesn't really matter.

Skele

Quote from: Snarky on Fri 12/05/2017 08:27:46
Just to be clear: once you've started playing the music, you don't need to make any more function calls to keep it playing as you change rooms. As long as you don't play anything else, it should just continue. What you should definitely not do is to put a call to start the music in the room_Afterfadein() of each room, since that will restart it from the beginning every time.

As Khris says, the music glitching when you change rooms is an old AGS bug (what happens is that the engine is so busy loading the next room that it doesn't have time to load the next snippet of music into memory, so it just plays the current snippet over and over).

The first thing to check is that the graphics driver is set to Direct3D in winsetup, as this usually fixes it (and since Crimson Wizard has recently fixed the problems that D3D used to have). Or perhaps even the OpenGL driver from the very latest test build.

If that's not enough, try setting room transitions to instant. (If you absolutely want the fade to black, there are other ways to do it.) And then, as pointed out in the other thread, try changing the audio format of the music.

If none of these things work, there's an experimental AGS build where the audio runs in a separate thread, so it doesn't have to wait while you're loading a room. The drawback is that the audio can get out of sync with the game, but if you're not trying to sync music or speech exactly with animation, that doesn't really matter.

Ah, i haven't made any more functions in the other rooms to keep it playing,
I'm going to try to change the transition to instant!
Thanky you too!

SMF spam blocked by CleanTalk