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

Author Topic: sf::Music setPlayingOffset() - big latency?  (Read 2337 times)

0 Members and 1 Guest are viewing this topic.

zakkor

  • Newbie
  • *
  • Posts: 27
    • View Profile
sf::Music setPlayingOffset() - big latency?
« 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!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: sf::Music setPlayingOffset() - big latency?
« Reply #1 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

zakkor

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: sf::Music setPlayingOffset() - big latency?
« Reply #2 on: November 03, 2014, 05:14:08 pm »
No, I am using the copy from the main page. Should I grab the latest version?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: sf::Music setPlayingOffset() - big latency?
« Reply #3 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: