How d I do I know exactly where in the wav file we currently are ?
sound.getPlayingPosition()
Is it documented (in 2.2) ? I don't find it in the doc. I have a sound.getPlayingOffset() but it returns a Time.
Anyway, I would need to have my function (that sets the volume according to the envelope and the current position) called each time a sample is played. How can I do that ?
Then I can probably cast away the const and apply my volume envelope to the samples. Dirty, but should work, right ?
Nop. The returned samples are just a copy of what's into the internal OpenAL buffer. Changing them will not update the OpenAL buffer. You must copy the samples, do your modifications, and put them back into a sound buffer with the loadFromSamples function. But this is pre-processing, and we have already discussed this option. Also, I have no idea what this has to do with sound streams
Bummer for the copy thing
The soundStream could allow me to have my volume envelope applied in a more dynamic fashion, "on the fly": if I pre-process (without sound stream), when the volume envelope changes I have to pre-process again (not sure but depending on the wav size, this may take too long).
On the other hand, a SoundStream could take the raw samples (no envelope) and apply the envelope each time a chunck is requested. If the chunk is small enough, the user will be able to change the envelope while playing.
I'll give it a try (as soon as possible) and let you know.
Thanks a lot for your replies and congrats for SFML: I'm really liking it ! (I use its sound and joystick stuff in some Qt apps).
MaX.