Page 1 of 1
Sound not working - releaseALC: 1 device not closed
Posted: Thu Oct 24, 2013 7:48 pm
by Ecurb
Hello,
I'm trying to use the pyglet library to play an mpf file in my program. After a good amount of fooling with it, it now works on my computer, however it does not work on the RP. The error message I get is "releaseALC: 1 device not closed". And the code I'm using is:
Code: Select all
music = pyglet.media.load("pig_sound1.mp3")
music.play()
pyglet.clock.schedule_once(exiter, music.duration)
pyglet.app.run()
Any ideas?
Bruce
Re: Sound not working - releaseALC: 1 device not closed
Posted: Fri Oct 25, 2013 8:30 am
by elParaguayo
Bruce,
Is that the full extent of the error message?
The reason I ask is that
this page shows that there might be another error when trying to play compressed media.
Please post the full error message and someone with some pyglet experience may be able to help.
el_P
Re: Sound not working - releaseALC: 1 device not closed
Posted: Fri Oct 25, 2013 8:43 pm
by Ecurb
hi el_P,
the full error says "AL lib: releaseALC: 1 device not closed"
maybe it has something to do with the library?
Bruce
Re: Sound not working - releaseALC: 1 device not closed
Posted: Fri Oct 25, 2013 9:51 pm
by Ecurb
or maybe there is an easier way to play some audio? I don't care if it's wav or mp3, just need to play some small clips.
Re: Sound not working - releaseALC: 1 device not closed
Posted: Sat Oct 26, 2013 8:13 am
by elParaguayo
Did you also install AVbin?
Re: Sound not working - releaseALC: 1 device not closed
Posted: Sat Oct 26, 2013 10:38 am
by elParaguayo
I get the following error:
Code: Select all
>>> import pyglet
>>> music = pyglet.media.load("immunity.mp3")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", line 1386, in load
source = _source_class(filename, file)
File "/usr/local/lib/python2.7/dist-packages/pyglet/media/riff.py", line 202, in __init__
'AVbin is required to decode compressed media')
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
and I've installed AVBin.
Let me know how you installed it and we can try to work through this.
As for other ways of playing media, I suspect searching the forums will give you some results - it's not something I use my Pis for.
Re: Sound not working - releaseALC: 1 device not closed
Posted: Sat Oct 26, 2013 11:01 am
by elParaguayo
Tried using pygame to play audio (see
this post) and it worked for me.
Pygame docs are here:
http://www.pygame.org/docs/ref/music.html
Re: Sound not working - releaseALC: 1 device not closed
Posted: Sat Oct 26, 2013 7:10 pm
by Ecurb
thanks all for the help! I ended up using pygame like in elParaguayo thread, worked perfect right away so just went with that.
Bruce