You can't directly record the single sf::Sounds, however you can capture the whole audio output (stereomix). So if you play music or get a Skype message you'd also hear it on the recording.
Besides that it depends on the devices provided by the OS/driver and the name of the device might be in the language of your OS.
On a German Windows 8.1 install, I could use this code:
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include <vector>
#include <string>
int main(int, char const**)
{
auto sr = sf::SoundBufferRecorder::getAvailableDevices();
for(auto &s : sr)
std::cout << s << std::endl;
sf::SoundBufferRecorder rec;
rec.setDevice("Stereomix (IDT High Definition Audio CODEC)");
sf::Sound sound(rec.getBuffer());
sf::RenderWindow window(sf::VideoMode(480, 320), "SFML window");
window.setKeyRepeatEnabled(false);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed) {
window.close();
}
else if (event.type == sf::Event::KeyPressed) {
sound.stop();
rec.start();
}
else if (event.type == sf::Event::KeyReleased) {
rec.stop();
sound.setBuffer(rec.getBuffer());
sound.play();
}
}
window.clear();
window.display();
}
}
The first part will list all the available recording devices. Then I select the "Stereomix" which is essentially what comes out of your speakers. Next I set the buffer of the sound to the recording buffer. To stop key press events from being repeated I disable the key repeat feature.
Now when you hold the key, it will start recording the sound and as soon as you release the key, it will stop recording and play it back to you.
If you have the sound buffers there would always be the possibility of manually manipulating the sound data, but if you want to do complex audio processing, you're better off looking at dedicated libraries.