simpleguitk
simpleguitk copied to clipboard
TypeError in sound.py
File "/usr/local/lib/python2.7/site-packages/simpleguitk/sound.py", line 62, in load_sound return Sound(URL) File "/usr/local/lib/python2.7/site-packages/simpleguitk/sound.py", line 22, in init self._sound = pygame.mixer.Sound(io.BytesIO(soundfile)) TypeError: Unrecognized argument (type _io.BytesIO)
I guess the problem is in line 22:
self._sound = pygame.mixer.Sound(io.BytesIO(soundfile))
should be something like:
self._sound = pygame.mixer.Sound(io.BytesIO(soundfile).read())
pygame version 1.9.2a0 OSX 10.9.2
Hi, pygame 1.9.1 seems to be the latest stable release and also the version provided by Homebrew. With 1.9.1 I'm unable to reproduce this issue and if I add .read()
to io.BytesIO
I get a TypeError instead.
Installed pygame with pip
pip install hg+http://bitbucket.org/pygame/pygame
That would install the latest development version from their mercurial repository. Did you intentionally want to install a development version? I would expect most users to install the stable version (1.9.1).
If you intentionally wanted to use the development version then we need to figure out a way to tell them apart so that it will work with both stable and dev.
It seems to work: self._sound = pygame.mixer.Sound(file = io.BytesIO(soundfile))
@PalmerX I tried it but it just generates an exception:
Traceback (most recent call last):
File "juicy_pong.py", line 61, in <module>
bounce0 = load_sound("https://dl.dropboxusercontent.com/u/32888156/JuicyPong/Blip%20003.wav")
File "../simpleguitk/simpleguitk/sound.py", line 62, in load_sound
return Sound(URL)
File "../simpleguitk/simpleguitk/sound.py", line 22, in __init__
self._sound = pygame.mixer.Sound(file=io.BytesIO(soundfile))
TypeError: function takes exactly 1 argument (0 given)
Do anyone has an update on this? Thanks!
@Dinh-Hung-Tu Which version of pygame are you using?
@dholm Hi David, I am using version 1.9.2
.
@Dinh-Hung-Tu Try using the HEAD version of simpleguitk and see if that resolves your issue.