Hi! First post in these forums : ) First of all, congratulations for this great library.
I'm working with sound in a project that is closely related to a karaoke. Therefore, I need access to sound buffers. At some point, sound/music is playing and I must get the raw values from the buffer from the exact playing offset.
It's easy by knowing its sample rate and the playing offset. However, sound.GetPlayingOffset() returns floats with just two decimals (e.g. 2.23) so the resolution is pretty low.
If I use Clock.GetElapsedTime() the precision is higher (e.g. 2.23154), which is more discriminative. Just see this example:
2.22 x 44100 -> 97902
2.23 x 44100 -> 98343
There are like 1000 samples lost in just 1/100 seconds. But it's even worse: many consecutive calls return the same playing offset, so I get the same sample even when time has obviously advanced (a few milliseconds, but it's not the same)
If I do something like this (just imagine that Sound is already playing):
std::cout << Clock.GetElapsedTime() << " " << Sound.GetPlayingOffset() << std::endl
see how Clock is much more precise than GetPlayingOffset in this few samples:
0.060948 0.06
0.0629533 0.06
0.0649569 0.06
0.0667986 0.06
0.0687719 0.06
0.0704301 0.07
0.072469 0.07
0.074509 0.07
0.0758784 0.07
0.0778292 0.07
I hope I managed to explain myself... Is it possible to increase GetPlayingOffset somehow?