Hi Daniel, sorry for the lateness.

sound services associated with scenes:
   1. those had been introduced with the SDL support, and never extended to
AVbin. To use AVbin do entirelly as in pyglet, ie not calling cocos sound
functions. Example in this pyweek entry http://code.google.com/p/aiamsori/

   2. that code is basically untested:
          people switching from AVbin to SDL adapted their code with a
minor refactor, without using the scene related calls. See for example
https://launchpad.net/enjuewemela

   3. I know no app using the scene sound api

The cost effective way for you would be to go with one of those approaches.

Additional info:
    SDL was easier to distribute in Linux, and better 'just work' factor in
user machines
    Windows was happy with both backends, but before committing to SDL now
I would test with win8 to win10 and the latest pygame available

hth

claudio

--



On Mon, Aug 31, 2015 at 6:48 AM, Daniel Gillet <[email protected]>
wrote:

> Hello,
>
> I'm trying to play some music with cocos2d. I'm a bit lost as why my music
> is not played. Here is a minimal code using pyglet which works:
>
> #!/usr/bin/python3
> #-*- encoding: utf-8 -*-
>
> import pyglet
>
> pyglet.resource.path = ['assets']
> pyglet.resource.reindex()
>
> music = pyglet.resource.media('ThemeEcranTitre2.mp3')
> music.play()
>
> pyglet.app.run()
>
> And here is my attempt in cocos2d which does not work (the windows open
> correctly but no music is played):
>
> import cocos
> from cocos.director import director
>
> director.init()
> intro = cocos.scene.Scene()
> import pdb; pdb.set_trace()
> intro.load_music("assets/ThemeEcranTitre2.mp3")
>
> director.run(intro)
>
> Trying to trace the problem, I found that when the scene enters, cocos is
> calling cocos.audio.music.control.load(self.music)which actually calls
> the DummyMusicControl implementation in cocos\audio\music.py.
>
> I want to use AVBin and it's installed on my machine. What am I doing
> wrong?
>
> I tried to use pygame instead, passing audio_backend='sdl' to
> director.init(). But this gives this exception:
>
> Traceback (most recent call last):
>   File "audio_test.py", line 21, in <module>
>     director.run(intro)
>   File "C:\Python34\lib\site-packages\cocos\director.py", line 402, in run
>     self._set_scene(scene)
>   File "C:\Python34\lib\site-packages\cocos\director.py", line 525, in
> _set_scene
>     scene.on_enter()
>   File "C:\Python34\lib\site-packages\cocos\scene.py", line 114, in
> on_enter
>     cocos.audio.music.control.load(self.music)
>   File "C:\Python34\lib\site-packages\cocos\audio\music.py", line 49, in
> load
>     pygame.music.load(filename)
> NameError: name 'pygame' is not defined
>
> Daniel.
>
> --
> You received this message because you are subscribed to the Google Groups
> "cocos2d discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/cocos-discuss.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.
  • mp3 music Daniel Gillet
    • Re: mp3 music claudio canepa

Reply via email to