No, you can't use void main. One of the key rules of C/C++ is that main MUST return an int. Any system which does not require this is in violation of the C++ standard.
Also, your problem is a scope problem. When the function ends and you aren't using pointers, the sound is automatically deleted, stopping the sound. You shouldn't be creating a function just for sound anyways, there's no reason to and it doesn't work. Also, you should probably reboot your computer. You've got a massive memory leak that probably hasn't been cleaned up properly by your OS (unless it's a more recent OS).