6

I've got a project in mind and I would like to use the spectrum analyzer of pymedia to get frequency data from audio while it's playing.

Has anyone managed to install it? I've tried and failed. I've emailed the pymedia mailing list but do far no response.

Has anyone managed to use it on the pi, or do you know another module or have some example code of how to get frequency data out of audio while it's playing?

Here's my email to pymedia mailing list:

Hi,

I have an idea for a project on the raspberry pi, www.raspberrypi.org, its a small arm based computer which runs linux and I have been trying to install pymedia.

I've used this post as the basis for getting it installed, and have managed to install all of the pre-requisites via apt-get (bar liblame-dev, which isn't available, Ill look to compile this as well if needed)

I receive the following when I try run sudo python setup.py install

OGG : not found
VORBIS : not found
FAAD : not found
MP3LAME : not found
VORBISENC : not found
ALSA : not found
Continue building pymedia ? [Y,n]:Y

When I continue, the installs run before erroring out with:

running build
running build_py
running build_ext
building 'pymedia.audio.acodec' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -DBUILD_NUM=1864 -DPATH_DEV_DSP="/dev/dsp" -DPATH_DEV_MIXER="/dev/mixer" -D_FILE_OFFSET_BITS=64 -DACCEL_DETECT=1 -DHAVE_MMX=1 -DHAVE_LINUX_DVD_STRUCT=1 -DDVD_STRUCT_IN_LINUX_CDROM_H=1 -DHAVE_AV_CONFIG_H -DUDF_CACHE=1 -I/home/pi/dev/pymedia/pymedia-1.3.7.3 -Iaudio/ -I/usr/include/python2.7 -c audio/acodec/acodec.c -o build/temp.linux-armv6l-2.7/audio/acodec/acodec.o
In file included from audio/libavcodec/avcodec.h:14:0,
from audio/acodec/acodec.c:30:
audio/libavcodec/common.h: In function âskip_bitsâ:
audio/libavcodec/common.h:571:1: warning: variable âre_cacheâ set but not used [-Wunused-but-set-variable]
In file included from audio/acodec/acodec.c:31:0:
audio/libavcodec/dsputil.h: At top level:
audio/libavcodec/dsputil.h:484:24: error: static declaration of âlrintfâ follows non-static declaration
audio/acodec/acodec.c:249:2: warning: initialization from incompatible pointer type [enabled by default]
audio/acodec/acodec.c:249:2: warning: (near initialization for âACStringType.tp_strâ) [enabled by default]
audio/acodec/acodec.c: In function âACodec_Encodeâ:
audio/acodec/acodec.c:668:5: warning: pointer targets in passing argument 2 of âavcodec_encode_audioâ differ in signedness

[-Wpointer-sign] audio/libavcodec/avcodec.h:1597:5: note: expected âunsigned char *â but argument is of type âchar *â error: command 'gcc' failed with exit status 1

Can anyone provide any advice about where to go next, or does anyone know it pymedia has been installed on a Pi before? Any advice greatly received.

  • 3
    That thing is ancient. It demands gcc 3.4 (not 4.x). There is no version of gcc 3.4 available at this time for arm. You will have to build that first. – GuySoft Jun 9 '13 at 14:03
  • I heard lots about cross compiling or something? Maybe that can help.. Not sure. – Piotr Kula Jun 13 '13 at 18:49
  • Have you got anywhere on this problem? If so, please create a self-answer and mark it as such. We're (at least I) am going through the site to try and get the question:answer ratio up. Thanks! – RPiAwesomeness Jan 1 '14 at 15:59
2

pymedia is quite old and not very active anymore. If at all possible, I would try to switch to pygame. Pygame is versatile, modern and active. I haven't tried to do exactly what you want to do, but I expect you will have an easier time getting support from that community than from pymedia

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.