Re: [pygame] Playing MP3 problem (background noise)

2007-12-10 Thread Nelson
Well..., I've been looking around and I'm almost convinced that this 
isn't an pygame/SDL problem. Since it also happens to .ogg and .wav 
files and I have the same problem when using play (sox) to play an wav 
file, but not with other players like mplayer. It seems some kind of 
ALSA init stuff.


Thanks,
Nelson
Luke Paireepinart wrote:

Nelson wrote:

Hi,

  The scenario is an fully updated FC6, with the SDL.mixer recompiled 
to enable mp3 support like this:
1) download SDL_mixer-1.2.7-2.fc6.src.rpm from source rpm repository. 
2) rpm -i SDL_mixer-1.2.7-2.fc6.src.rpm 3) cd /usr/src/redhat/SPECS 
4) edit SDL_mixer.spec, and change line 48 from: %configure 
--disable-dependency-tracking --disable-static to  %configure 
--disable-dependency-tracking --disable-static --enable-music-mp3 5) 
build the rpms: rpmbuild -bb SDL_mixer.spec 6) install: cd 
/usr/src/redhat/RPMS/i386; rpm -i SDL_mixer-1.2.7-2.i386.rpm; rpm -i 
SDL_mixer-devel-1.2.7-2.i386.rpm 7) yum install pygame pygame-devel



  The code is:
import pygame
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load('s.mp3')
pygame.mixer.music.play()
while 1:
  pass

  The s.mp3 is an valid MP3 that mplayer plays without problems, but 
the above code plays the mp3 with an annoying background noise (it 
looks like an very old vinyl LP disc). Is this an pygame problem or 
an SDL problem? Did anyone had the same problem (i tryed on 2 
different systems with the same effect (FC6 and CentOS5).


Thanks,
Nelson

Lots of other people had this problem when Feisty Fawn came out.  Look 
in the archives and see if any of those fixes work for you.






Re: [pygame] Playing MP3 problem (background noise)

2007-12-09 Thread Luke Paireepinart

Nelson wrote:

Hi,

  The scenario is an fully updated FC6, with the SDL.mixer recompiled 
to enable mp3 support like this:
1) download SDL_mixer-1.2.7-2.fc6.src.rpm from source rpm repository. 
2) rpm -i SDL_mixer-1.2.7-2.fc6.src.rpm 3) cd /usr/src/redhat/SPECS 4) 
edit SDL_mixer.spec, and change line 48 from: %configure 
--disable-dependency-tracking --disable-static to  %configure 
--disable-dependency-tracking --disable-static --enable-music-mp3 5) 
build the rpms: rpmbuild -bb SDL_mixer.spec 6) install: cd 
/usr/src/redhat/RPMS/i386; rpm -i SDL_mixer-1.2.7-2.i386.rpm; rpm -i 
SDL_mixer-devel-1.2.7-2.i386.rpm 7) yum install pygame pygame-devel



  The code is:
import pygame
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load('s.mp3')
pygame.mixer.music.play()
while 1:
  pass

  The s.mp3 is an valid MP3 that mplayer plays without problems, but 
the above code plays the mp3 with an annoying background noise (it 
looks like an very old vinyl LP disc). Is this an pygame problem or an 
SDL problem? Did anyone had the same problem (i tryed on 2 different 
systems with the same effect (FC6 and CentOS5).


Thanks,
Nelson

Lots of other people had this problem when Feisty Fawn came out.  Look 
in the archives and see if any of those fixes work for you.


Re: [pygame] Playing MP3 problem (background noise)

2007-12-09 Thread Casey Duncan

On Dec 9, 2007, at 8:52 AM, Nelson wrote:


while 1:
  pass


This may have absolutely nothing to do with it, but this code will  
completely consume a cpu while doing nothing, which may adversely  
effect other operations that need cpu, such as mp3 decoding. You  
might try replacing it with:


while 1:
time.sleep(1)

or a call to pygame.event.wait() or something else that does not busy- 
wait.


-Casey


[pygame] Playing MP3 problem (background noise)

2007-12-09 Thread Nelson

Hi,

  The scenario is an fully updated FC6, with the SDL.mixer recompiled 
to enable mp3 support like this:
1) download SDL_mixer-1.2.7-2.fc6.src.rpm from source rpm repository. 2) 
rpm -i SDL_mixer-1.2.7-2.fc6.src.rpm 3) cd /usr/src/redhat/SPECS 4) edit 
SDL_mixer.spec, and change line 48 from: %configure 
--disable-dependency-tracking --disable-static to  %configure 
--disable-dependency-tracking --disable-static --enable-music-mp3 5) 
build the rpms: rpmbuild -bb SDL_mixer.spec 6) install: cd 
/usr/src/redhat/RPMS/i386; rpm -i SDL_mixer-1.2.7-2.i386.rpm; rpm -i 
SDL_mixer-devel-1.2.7-2.i386.rpm 7) yum install pygame pygame-devel



  The code is:
import pygame
pygame.init()
pygame.mixer.init()
pygame.mixer.music.load('s.mp3')
pygame.mixer.music.play()
while 1:
  pass

  The s.mp3 is an valid MP3 that mplayer plays without problems, but 
the above code plays the mp3 with an annoying background noise (it looks 
like an very old vinyl LP disc). Is this an pygame problem or an SDL 
problem? Did anyone had the same problem (i tryed on 2 different systems 
with the same effect (FC6 and CentOS5).


Thanks,
Nelson