Here's the wiki page for loading and playing sounds in JSFML:
https://github.com/pdinklag/JSFML/wiki/SoundBuffers-and-SoundsIn order to play a sound properly, it needs to be kept in memory, so yes, you would need to somehow wait until it finished playing. If your program doesn't wait, it will terminate before the sound is done playing, and thus it will be garbage-collected and interrupted.
If you have a window with a main loop, that should be no problem generally. If you, for some reason, want a program that only plays a sound, a simple call of
Thread.sleep might do the trick just as well.
I suppose you use the Sound class for playing your sound? In that case, instead of tampering with the sample rate (which would require you to implement your own stream class), you can simply modify the sound's pitch (
https://github.com/pdinklag/JSFML/wiki/SoundBuffers-and-Sounds#volume-and-pitch). The effect should be exactly what you are looking for.