SFML community forums

Help => Audio => Topic started by: zakkor on November 03, 2014, 03:59:55 pm

Title: sf::Music setPlayingOffset() - big latency?
Post by: zakkor on November 03, 2014, 03:59:55 pm
Using setPlayingOffset() to seek through a short song (1 min) works with no noticeable latency, however when I try a longer (5.5 min) song it lags for about 2 seconds before resuming playback. Should this be happening? Can it be fixed, should I use sf::Sound, or what?

Not sure if it helps much, but here's the code where I call the function:
...
sf::Time t = sf::seconds(music.getDuration().asSeconds() * barPerc);
music.setPlayingOffset(t);
...
 

Please do tell if you need anything else!
Title: Re: sf::Music setPlayingOffset() - big latency?
Post by: Nexus on November 03, 2014, 04:16:24 pm
Are you using the latest master revision from GitHub?

By the way, you don't need to convert seconds to float and back for multiplication. Just make sure the factor is a float value.
Title: Re: sf::Music setPlayingOffset() - big latency?
Post by: zakkor on November 03, 2014, 05:14:08 pm
No, I am using the copy from the main page. Should I grab the latest version?
Title: Re: sf::Music setPlayingOffset() - big latency?
Post by: Nexus on November 03, 2014, 05:17:05 pm
Yes. You should always do that if you report a potential bug. Chances are that the implementation has changed and things have been fixed meanwhile.