Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Play a music just after another without delay

$
0
0

@Noxalus wrote:

Hello everyone :slight_smile:

I have a theme with an intro and a loopable part that I decomposed intro 2 differents OGG file, and I would like to play the intro part then, when the intro is finished, I would like to play the loopable part without any delay.

I've already did some searches, and I found 2 things:

  • MP3 are bad for looping
  • There is always a delay when we loop a music using MediaManager

So, it seems wrong, but I use SoundEffect for my musics, and I can loop them seamlessly thanks to SoundEffectInstance.

But if I try to play a music just after another one, there is still a little delay (tested on Windows and Android, the behaviour is the same).

Here is what I do:

SoundEffectInstance intro;
SoundEffectInstance loop;

private void PlayMusic()
{
  intro.Play();
}

// Called every frame
private void Update()
{
  if (intro.State == SoundState.Stopped)
      loop.Play();
}

I think that when the SoundState is set to Stopped for the intro part, it's already too late, but I don't really know how I can fix that :confused:

The SoundEffectInstance is pretty simple, it doesn't seem to be possible to get the current progress.

Did you already encounter thie issue? Do you have any idea to fix it?

Thanks a lot in advance :slight_smile:

Note: I use MonoGame 3.6.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles