While I can't find anything in sfml that allows actual buffer destruction, you 
can reassign buffers.  I just tried this, and it worked perfectly.

    if (!buffer1.LoadFromFile("sound/background.wav"))
        printf("error is: %d\n",EXIT_SUCCESS);
    sf::Sound Background(buffer1);
if (!buffer2.LoadFromFile("sound/helicopter.wav"))
printf("error is: %d\n",EXIT_SUCCESS);
    sf::Sound Helicopter(buffer2);

While this doesn't actually destroy the contents of the buffer, it does allow 
you to reassign what sounds the call to any particular sound.play function will 
It won't help with memory usage I'm afraid, but it will solve your problem with 
needing to change sounds on the fly w/o modifying the code being called to play 
the sounds.

Failing that, there is a function (for internal use only) that is used to reset 
buffers.  I've not looked at the source for it, but it's possible you could use 
that one if you needed to actually delete the buffers in question.
Hope this helps.

Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
All messages are archived and can be searched and read at
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to