Reputation:
Is there any way to read the current sample that's been playing in sf::Music for further inspection using FFT algorithms and such?
Just like you would do using sf::SoundBuffer with getSamples().
Upvotes: 0
Views: 250
Reputation: 36537
No, not really. But considering you'll want a significant portion of your file (or maybe everything) in memory anyway, just use sf::SoundBuffer
and sf::Sound
for this.
To get the sample for the current playback position you'd have to do some calculation like samplesPerSecond * playbackPosition
. Just interpolate the time between the last and current calculation.
Upvotes: 0