22

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.
xxjjnn
  • 14,591
  • 19
  • 61
  • 94
  • I altered line 53 to read .so, still didn't help. Installing Stable version 7 worked... 8 was unstable! – xxjjnn Apr 24 '12 at 20:43

8 Answers8

10

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
Sebastian
  • 5,721
  • 3
  • 43
  • 69
9

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.

Joe Marshall
  • 111
  • 1
  • 2
4

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...

xxjjnn
  • 14,591
  • 19
  • 61
  • 94
4

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.

L1fescape
  • 81
  • 5
4

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
joydeep bhattacharjee
  • 1,249
  • 4
  • 16
  • 42
  • 1
    This answer did it for me. I got FLAC playing as soon as I had installed it. Thanks so much! (As an aside, the common issue of silent playing I keep reading about and had experienced myself was resolved with this line: `pyglet.options['audio'] = ('openal', 'pulse', 'directsound', 'silent')`. Hope that helps someone! – dingles Dec 07 '18 at 18:41
4

My OS is Windows10 64bits.

The issue:

pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media

How to fix it on Windows10:

  1. 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.

  2. The .exe from 1. extracts the avbin.dll into windows/system32/ folder.
    Please cut/copy it and paste to windows/system/ folder. It looks windows10 refers to only 32bits AVbin but not 64bits.

  3. You're good to go. Try it !

ChihWei
  • 269
  • 1
  • 4
3

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...)

Mattstir
  • 175
  • 10
2

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.

Piotr Owsiak
  • 6,081
  • 8
  • 39
  • 42