Yes, it plays in a thread, which is why play() is non-blocking. (= the program continues to run while the sound plays) But that thread dies when the Sound is destroyed.
// outside your main loop
sf::SoundBuffer w;
sf::Sound s;
//...
if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
if (gameState->mPlayerFireCooldown <= 0.0f)
{
// ...
w.loadFromFile("../assets/shot.wav");
s.setBuffer(w);
s.play();
}
}
You could even load your sound before the main loop, since loading can take time.