Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CvxFous

Pages: [1]
1
Audio / Re: sf::Music fails to loop after seeking
« on: March 25, 2020, 08:07:11 pm »
Hi, it can be any file, I tested it even with twice the same sound.

The format is .ogg

One thing important to know is that sometimes it does work, depending on the offset seeked

EDIT: I'll try converting my file to .wav to see if this is any different.

EDIT2: So with wav it still doesn't work properly, I've observed three scenarios:
- It does work properly (1/10 tests)
- It loops but start the second loop at a different point in time before setting it back to the beginning, then the third and the loop after are correct (8/10 tests)
- It loops at a different starting point to a different ending point (1/10 tests)

What is going on?

Files used for this test:

2
Audio / Re: sf::Music fails to loop after seeking
« on: March 24, 2020, 09:43:59 pm »
Hi,

I know this topic is almost one year old,but the problem described here is exactly what I have, so I feel like I shouldn't create a new topic for the same issue.

I have two musics, musicA and musicB, same length, one with bass, the other with bass + drums + guitar.
Whenever I finish a level in my game, I want to pause musicA, get the currentOffset and start musicB.

In practice it works fine and all, but the loop is screwed up depending on where you seek. Most of the time it results in the music stopping right at the end without looping.
void Level::switchMusic(bool toVictoryScreen) {
  if (toVictoryScreen) {
    _music.pause();
    const sf::Time musicOffset = _music.getPlayingOffset();
    _musicVictory.setPlayingOffset(musicOffset);
    _musicVictory.play();
  }
  else {
    _musicVictory.pause();
    const sf::Time musicOffset = _musicVictory.getPlayingOffset();
    _music.setPlayingOffset(musicOffset);
    _music.play();
  }
}
 

Is there any fix yet for this issue?

OS: WIndows 10 and/or Ubuntu 18.04
SFML 2.5.1

Pages: [1]