On Fri, Aug 5, 2011 at 3:52 PM, claudio canepa <[email protected]> wrote:
> @Facundo: If you take the cocos\audio (SDL sound) approach and write down > some hints for other users I will buy you some beer at PyConAr 2011 . Deal ? Ok. Enjuewemela now uses the SDL backend (see trunk, revno 77). The most problematic stuff I faced is that in the game I play a random background music, so when a song finishes, I randomly chose other one and start to play it. But I couldn't make events work!! I heavily suspect that the event machinery doesn't really work without the pygame graphical environment set up (for its internal reactor, or something), but as in the cocos pygame stuff there's a lot of code for events, I kept trying. Anyway, I solved it using a pyglet scheduled call, so each second I check if the song finished, and start a new one if did. Works smoothly. So... Claudio: - You can test Enjuewemela with the new audio backend... just branch trunk, and run "python enjuewemela/demo_sound.py": you should get a black window with background music, with left button you get a short sound effect (useful to check lag between graph and audio) and with the right button you get a long effect (useful to see what happens when an effect overlaps de other). - There was a problem in cocos/audio/pygame/music.py, because the unpause() function called the Mix_UnpauseMusic symbol from the compiled library, but it really needs to call Mix_ResumeMusic. I fixed this in r1116 of cocos. - I want to earn the promised beer! What do you mean with "some hints for other users"? Thanks for everything! Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en.
