SFML community forums
Help => Audio => Topic started by: Agito on March 26, 2010, 01:15:37 pm
-
Hi guys/girls,
I started coding a simple breakout clone and used the sf::Music class for the background music.
The problem is, the programm can be exited by pressing [exit] or simply clicking the [X]. After the main programm closes, the sound continues to run.
I am using Ubuntu 9.04 with SFML 1.5.
In System Monitor I see the main programm (the music thread part I guess) after I closed the main programm. I tried the Stop() funnction and creating the Music object on the Heap and deleting it, but this part of the programm just won't quit, and I cannot access Terminate() since its declared private in the class above sf::Music
I guess I am overlooking something, is there a way to end the Music thread before the whole soundfile has played?
thx in advance,
Agito
-
Well, until other solutions, would you give 1.6 a try? There is a lot of bug fixed in that. Switching from 1.5 to 1.6 also fixed my problem, so mybe it worth a try :)
-
Well, I am not sure wether this is a bug or just me being stupid...
-
It seems to me, that this should be a bug, cause I think that's the way, how sf::Music meant to be used.
-
You should show us your code (a minimal one, if it's too big).
-
http://codepad.org/JnBsV8mQ heres my full code, all in one file
i'm really puzzled about this
-
You should try two things:
1. allocate the music on the stack, so that you don't need to call Stop() and delete.
2. remove all the graphics part so that we can focus on the problem ;)
-
found the problem, the while(1) loop was the problem