AVBin is used by Pyglet to decode MP3s. Link: http://avbin.github.com/AVbin/Download.html
Installed using install.sh provided, when utilised leads to error:
'AVbin is required to decode compressed media')
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
...So it didn't install properly? Using python virtualenv, suspect this might be causing issues... though I ran AVBin's install.sh in virtualenv, like this:
(SoundShenanigans)user@computer:~/Downloads/avbin-linux-x86-64-v8$ sudo bash install.sh
UPDATE
I have found where avbin is installed... it seems to be installed in the right place =S
~/pyvien/SoundShenanigans/lib/python2.7/site-packages/pyglet/media$ ls
avbin.py drivers __init__.pyc procedural.pyc riff.pyc
avbin.pyc __init__.py procedural.py riff.py
UPDATE 2
The library is .so , not .dylib , why do you want .dylib mysterious code? This is Linux not Mac (Mac's have .dylib, Ubuntu has .so)
File "SoundShenanigans.py", line 4, in
from pyglet.media import avbin
File "/home/user/pyvien/SoundShenanigans/local/lib/python2.7/site-packages/pyglet/media/avbin.py", line 53, in
darwin='/usr/local/lib/libavbin.dylib')
File "/home/user/pyvien/SoundShenanigans/local/lib/python2.7/site-packages/pyglet/lib.py", line 122, in load_library
raise ImportError('Library "%s" not found.' % names[0])
ImportError: Library "avbin" not found.
What about installing it by:
sudo apt-get install libavbin-dev libavbin0
More information about this package: http://packages.ubuntu.com/source/avbin
Edit: It looks like it is not included anymore for newer ubuntu versions. So you have to download it from https://avbin.github.io/AVbin/Download.html and install it via
sudo sh ./install-avbin-linux-x86-64-v10
I had the same problem on Windows, and there's no installer for python 2.7 on Windows.
If you put the avbin dll in your folder (or install it globally using the installer), then write:
pyglet.lib.load_library('avbin')
pyglet.have_avbin=True
after the import of pyglet, like this:
import pyglet
pyglet.lib.load_library('avbin')
pyglet.have_avbin=True
It will load and use avbin happily.
I went super saiyan banging my head against the wall, and broke through it.
The solution is to install the STABLE release, rather than the latest. All it needs is a little
:~/Downloads/avbin-linux-x86-64-7$ sudo ./install.sh
And it works. I think they have a mix up with their installers...
For me specifically it was installing AVbin 7 from here.
AVbin 8 and 10 just seemed to run, but there wasn't any sound coming out.
Running 32bit Ubuntu 12.04.
Download the specific installer from here.
Then go to the download folder and run it using sudo.
For example in my case I ran the following:
wget https://github.com/downloads/AVbin/AVbin/install-avbin-linux-x86-64-v10
sudo install-avbin-linux-x86-64-v10
I had this issue on Windows and found this question via a search engine so I thought I'd share my experience and solution.
I tried to load w WMV file (at least that's the extension) and got the same exception as described in the question but my problem was due to the fact that I installed pyglet using 'pip install pyglet' command and then AVBin from an installer.
What solved the problem for me was an installation of pyglet from an installer found on the project site, it contains AVBin and then everything worked fine.
For me, I had to manually move the dll to the correct folder.
Due to a bug in the AVBin installer, it installs in C:\Windows\System32
when it should've been placed in C:\Windows\SysWOW64
.
(Assuming you are on Windows!)
To fix this, all you have to do is go into C:\Windows\System32
and find avbin.dll
(or avbin64.dll
if you are on a 64 bit system) and manually cut-and-paste it into C:\Windows\SysWOW64
.
(Or if you're me and downloaded both dlls then move both...)
My OS is Windows10 64bits.
The issue:
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
How to fix it on Windows10:
Download 32bits AVbin.dll from AVbin Downloads
Please note: The 64bits AVbin dll does NOT work even you're using 64bits Win10.
So please download the 32bits instead.The .exe from 1. extracts the
avbin.dll
intowindows/system32/
folder.
Please cut/copy it and paste towindows/system/
folder. It looks windows10 refers to only 32bits AVbin but not 64bits.You're good to go. Try it !
来源:https://stackoverflow.com/questions/10302873/python-pyglet-avbin-how-to-install-avbin