I think your problem, that the sounds stop, is somewhere else. alGetSourcei
is not required to keep the sound playing.
Anyway you can't do that in a while loop because it will block the update of the windows messages and OpenGL and will prevent the scene from redrawing.
To play it you just need to call alSourcePlay
, after this you could check each frame if the source is still playing ( if you need to do this for some reason ).