I'm trying to analyze a sound in SFML2. I'm accessing the SoundBuffer data like this:
#include <SFML/Audio.hpp>
#include <iostream>
int main() {
sf::SoundBuffer buffer;
buffer.LoadFromFile("no quiet.ogg");
sf::Sound sound;
sound.SetBuffer(buffer);
sound.Play();
while (sound.GetStatus() == sf::Sound::Playing) {
std::cout << buffer.GetSamples()[int(sound.GetPlayingOffset()*buffer.GetSampleRate())] << std::endl;
sf::Sleep(0.01);
}
}
Is this a good way to access the buffer? And how does SFML handle stereo sounds?