Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with SDL/pygame audio #348

Open
dbenndorf opened this issue Oct 4, 2021 · 0 comments
Open

Issues with SDL/pygame audio #348

dbenndorf opened this issue Oct 4, 2021 · 0 comments

Comments

@dbenndorf
Copy link

Hi. I'm a new user of cocos2d and I find the API awesome. I haven't completely mastered cocos2d or Python, but I think I've found a possible bug. I tried to play a music in the my Menu Scene but I got the following error message:

File "/usr/local/lib/python3.8/dist-packages/cocos/director.py", line 379, in run
self._set_scene(scene)
File "/usr/local/lib/python3.8/dist-packages/cocos/director.py", line 513, in _set_scene
scene.on_enter()
File "/usr/local/lib/python3.8/dist-packages/cocos/scene.py", line 91, in on_enter
cocos.audio.music.control.load(self.music)
File "/usr/local/lib/python3.8/dist-packages/cocos/audio/music.py", line 50, in load
pygame.music.load(filename)
NameError: name 'pygame' is not defined

It appears to be an import issue, so I went to the file and edited it so that it imported the package correctly, but I got the following:

File "/usr/local/lib/python3.8/dist-packages/cocos/director.py", line 379, in run
self._set_scene(scene)
File "/usr/local/lib/python3.8/dist-packages/cocos/director.py", line 513, in _set_scene
scene.on_enter()
File "/usr/local/lib/python3.8/dist-packages/cocos/scene.py", line 91, in on_enter
cocos.audio.music.control.load(self.music)
File "/usr/local/lib/python3.8/dist-packages/cocos/audio/music.py", line 50, in load
cocos.audio.pygame.music.load(filename)
File "/usr/local/lib/python3.8/dist-packages/cocos/audio/pygame/music.py", line 86, in load
_current_music = Mix_LoadMUS(filename)
File "/usr/local/lib/python3.8/dist-packages/cocos/audio/SDL/dll.py", line 241, in _f
result = func(*args, **kwargs)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type

I tried with an mp3 file and with a wav file. Pyglet option doesn't work either, but without any error message. I hope to be helping and I want to contribute to the project in the future, if possible. If this is not a bug, feel free to delete the post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant