Re: [pygame] Hi I'm New

2007-12-09 Thread Luke Paireepinart

earlylight publishing wrote:

Hello Everyone,
 
I'm new to the list, new to Python/Pygame, and new to programming in 
general.  I'm learning Python/Pygame because I want to make 
educational games.  I'm a single mom with a full time job so it goes 
without saying that I'll be doing this part time and with next to zero 
budget.  Still the learning is going smoothly and I am very hopeful 
that I'll be able to achieve my goals.  Because I'm so inexperienced, 
I'll most likely just be lurking and learning around here at first.  
I'm glad to be here and I know I'll learn lots!

Please, don't hit "reply" and change the subject when creating a new thread.
There are other factors than just the subject that e-mail clients use to 
thread messages, so your post (and all replies) end up under the 
"Playing MP3 Problem" thread in my e-mail client, instead of in a 
separate one.

Thanks,
-luke


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


Re: [pygame] Hi I'm New

2007-12-09 Thread Laura Creighton
Welcome.  Another place to find us is in the channel #pygame on irc.freenode.net

turnaround is somewhat faster.

Laura



[pygame] Hi I'm New

2007-12-09 Thread earlylight publishing
Hello Everyone,
   
  I'm new to the list, new to Python/Pygame, and new to programming in general. 
 I'm learning Python/Pygame because I want to make educational games.  I'm a 
single mom with a full time job so it goes without saying that I'll be doing 
this part time and with next to zero budget.  Still the learning is going 
smoothly and I am very hopeful that I'll be able to achieve my goals.  Because 
I'm so inexperienced, I'll most likely just be lurking and learning around here 
at first.  I'm glad to be here and I know I'll learn lots!

   
-
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

[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


Re: [pygame] Good code

2007-12-09 Thread David Gowers
Hi Laura

On Dec 9, 2007 6:04 PM, Laura Creighton <[EMAIL PROTECTED]> wrote:
>
> I think one of the most useful places to write comments -- and one
> which I think is rarely done -- is
>
> # hack hack hack ! this function should really do XXX instead of YYY
> # that it does now

This is a great use of comments.
In open source software, there is a casual convention like:

# XXX simplify the logic of this function

. In some games, notably *angband, this evolves into

# XXX hack: force a 'good' depth.
(in distinction from XXX - 'XXX' just meaning code that does not give
you a good feeling about how it does things, whereas 'XXX hack' is
meaning something that you know is inappropriate to do but currently
works.)

>
> That way, when you come across it later, you can be sure that
> this is code you meant to clean up and never got around to, rather
> than code that was done in this strange way on purpose.
>
> Laura
>
>