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

Author Topic: How to get the current audio sample during realtime using sf::Music?  (Read 2776 times)

0 Members and 1 Guest are viewing this topic.

Barkypoo

  • Newbie
  • *
  • Posts: 1
    • View Profile
Title says it all, really

I've been working on a FFT application, and been using sf::Sound since then. However, when playing big files (1+ minute) you can perceive some lag in it, at certain times.

How do I, then, get the same result from
mySoundBuffer.getSamples()[iterator]
into
sf::Music
?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: How to get the current audio sample during realtime using sf::Music?
« Reply #1 on: April 27, 2018, 09:27:30 am »
As shown in the official tutorial. Keep in mind that this is always just an approximation to "real-time" as you can't fully know when the samples are really being played, but this should get you very close to it. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything