[pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-28 Thread Terry Hancock
Hi all,

I'm writing a tutorial for Python using PyGame, and one thing
that bothers me is that I'm not entirely certain that my PyGame
is a plain installation.

In fact, I'm pretty certain that I have some extras installed,
which makes me worry that some stuff that works for me may not
work for people reading the tutorial.

I've already made sure to use BMP files exclusively for images.

But what about sound files? Does pygame.mixer.music *always*
support Ogg files? I know my installation does.

I'm using WAV files for sound effects, but
it's a lot nicer to use Ogg Vorbis for music. Is it safe to
assume that anyone who's installed PyGame will have this
ability?

Also, one person has complained about installation problems on
Fedora Core and also on OS X. Are there binary bundles that
work well on those platforms? I assume Windows is covered,
and I know the Debian installation "just works".

Cheers,
Terry

-- 
Terry Hancock ([EMAIL PROTECTED])
Anansi Spaceworks http://www.AnansiSpaceworks.com



Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-28 Thread Patrick Mullen
Don't know anything about the osx or debian problems (with OSX I
expect the issue may be with whatever python version the user has by
default, and which pygame packages are available), but ogg vorbis is
definitely supported.  Mp3 support is a bit off, so you should always
use ogg vorbis instead.  How do you have extras installed?  AFAIK
there is only pygame.

Good luck with the tutorial.


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-28 Thread Brian Fisher
a quick response is that pygame can be compiled with various parts not
included, so depending on who compiled pygame or the underlying sdl
and how, it can be missing support for various pieces and file
formats.

...however, in all official installers for windows and mac all
optional components are built in, and furthermore on those platforms
the installers include all binary dependencies. i.e. no features or
file format support will be available or not depending on what the
user has installed besides pygame (note I'm not saying python modules
pygame interoperates with are installed though, i.e. you got to
install PyOpenGL or numpy seperate)

So basically I'm saying I can see there may be feature & file format
support problems in what I would consider exceptional cases, most of
which I would expect is Linux. I think it would be great to understand
those cases better and possibly provide solutions for them (i.e. make
sure the ports files install all the right stuff, fix a distro, etc.)
so Terry (and others) please provide details on cases where a pygame
feature doesn't seem to be included.

-more below-

On Fri, Mar 28, 2008 at 10:43 AM, Terry Hancock
<[EMAIL PROTECTED]> wrote:
>  I'm writing a tutorial for Python using PyGame, and one thing
>  that bothers me is that I'm not entirely certain that my PyGame
>  is a plain installation.
>
How did you install?


>  In fact, I'm pretty certain that I have some extras installed,
>  which makes me worry that some stuff that works for me may not
>  work for people reading the tutorial.
>
What OS are you using? what makes you think you have extras?


>  I've already made sure to use BMP files exclusively for images.
>
Why BMP files exclusively? what image files are you avoiding? Why are
you avoiding them


>  But what about sound files? Does pygame.mixer.music *always*
>  support Ogg files? I know my installation does.
>
SDL_mixer can be built without ogg vorbis support - but I don't see
why it would be. again, if there is a case where it is, it would be
good to get that fixed.


>  Also, one person has complained about installation problems on
>  Fedora Core and also on OS X. Are there binary bundles that
>  work well on those platforms? I assume Windows is covered,
>  and I know the Debian installation "just works".
>
I don't know about Fedora, but it's my expectation that OS X prebuilt
installer support for pygame 1.8 is sufficient for all needs. If there
is any circumstance where that is not the case, please let the list
know so it can be fixed.

Also, OS X support for pygame 1.7 has been lacking in that a prebuilt
python 2.5 installer was not available for a long period of time,
which may be where that part of the complaint originated.


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-28 Thread James Paige
On Fri, Mar 28, 2008 at 12:43:09PM -0500, Terry Hancock wrote:
> Hi all,
> 
> I'm writing a tutorial for Python using PyGame, and one thing
> that bothers me is that I'm not entirely certain that my PyGame
> is a plain installation.
> 
> In fact, I'm pretty certain that I have some extras installed,
> which makes me worry that some stuff that works for me may not
> work for people reading the tutorial.
> 
> I've already made sure to use BMP files exclusively for images.
>
> But what about sound files? Does pygame.mixer.music *always*
> support Ogg files? I know my installation does.
> 
> I'm using WAV files for sound effects, but
> it's a lot nicer to use Ogg Vorbis for music. Is it safe to
> assume that anyone who's installed PyGame will have this
> ability?

Although it is theoretically possible to compile pygame's support 
libraries without support for PNG images and OGG sounds, such a build 
would be broken.

---
James


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread ����������
I've written a tutorial on sound with pygame.

You can find it at http://takira.freehosting.net/

Feel free to extend it or whatever.

Also at the same page you can find the PyMP program
which  aims to play sound files the pygame way. It
should be useful.

Now for the *.ogg files, they sure are playable in
Linux and Windows.

Good luck with your tutorial.
Takis



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ



Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread FT

Hi!

I had asked before but centered it on recording and was given the page
for the mixer but no record features. The burning onto CD is resolved and
works fine but do we have a way to translate wav to OGG?

I would like to know if someone has written a module to convert formats
into other formats?

I have not gone to the tutorial page mentioned below yet, but would like
to know since OGG files are much smaller then wav files.

Bruce

Subject: Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?


I've written a tutorial on sound with pygame.

You can find it at http://takira.freehosting.net/

Feel free to extend it or whatever.

Also at the same page you can find the PyMP program
which  aims to play sound files the pygame way. It
should be useful.

Now for the *.ogg files, they sure are playable in
Linux and Windows.

Good luck with your tutorial.
Takis






Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.1/1348 - Release Date: 3/28/2008
10:58 AM




Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread Brian Fisher
There are no current plans to add features for authoring sounds (i.e.
recording or saving audio files) to pygame

However you can do that stuff in python with PyMedia:
http://pymedia.org//features.html

If you just want to convert files to ogg without using python, oggenc
and oggdrop can do it (command-line and gui respectively):
http://www.rarewares.org/ogg.php


On Sat, Mar 29, 2008 at 5:21 AM, FT <[EMAIL PROTECTED]> wrote:
>
>  Hi!
>
> I had asked before but centered it on recording and was given the page
>  for the mixer but no record features. The burning onto CD is resolved and
>  works fine but do we have a way to translate wav to OGG?
>
> I would like to know if someone has written a module to convert formats
>  into other formats?
>


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread James Paige
On Sat, Mar 29, 2008 at 07:21:26AM -0500, FT wrote:
> 
> Hi!
> 
> I had asked before but centered it on recording and was given the page
> for the mixer but no record features. The burning onto CD is resolved and
> works fine but do we have a way to translate wav to OGG?
> 
> I would like to know if someone has written a module to convert formats
> into other formats?
> 
> I have not gone to the tutorial page mentioned below yet, but would like
> to know since OGG files are much smaller then wav files.
> 
> Bruce
> 

If you mean a way to convert wav to ogg inside a pythong program, then 
no, but if you are just talking about converting wav to ogg in general, 
yes, there are plenty of tools.

On Linux look for the oggenc program, which comes standard as part of 
the vorbis-tools

On windows you can use the graphical OggdropXPd from 
http://www.rarewares.org/ogg-oggdropxpd.php

And another good option is the SoX tool from http://sox.sourceforge.net/

And finally, if you want something really graphical, with editing and 
filter&effect capabilities too, The http://audacity.sourceforge.net/ 
sound recorder/editor can save/load both wav and ogg format. It runs on 
all three major platforms.

---
James Paige


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread Ian Mallett
I love Audacity!


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-29 Thread FT

Hi Ian,

Thanks, I downloaded it and saving some of my wav files as ogg. I wanted 
something that allowed me to easily convert all those huge wav files into 
something transportable and small.

Prior to you sending this I had found one other converter but not friendly 
to screen readers. This one does at least have a file menu, not just buttons on 
the screen that can only be reached by mouse clicks.

So I have what I need to convert my Battle Ship game to .ogg files. The 
game does do the game with 2 players or computer to play against. I have a 
level one and 2 for the computer and a third which will be hard to beat in a 
few hours. Then you will be able to select levels, but not yet.

Nice sound and voice for anyone to play, but no video, at least not in the 
near future.

Bruce



I love Audacity!



Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-31 Thread Terry Hancock
Brian Fisher wrote:
>>  I've already made sure to use BMP files exclusively for images.
>>
> Why BMP files exclusively? what image files are you avoiding? Why are
> you avoiding them

Because the documentation (still?) says that only BMP support is guaranteed:

>From the documentation installed w/ my PyGame package:
"""
At the minimum the included load() function will support BMP files.
"""

>From http://www.pygame.org/docs/ref/image.html:
"""
By default it can only load uncompressed BMP images.
"""

I also know from experience that with early versions of PyGame, only BMP
was supported and it was necessary to convert your images to work with
it. These documentation passages suggest that not much has changed in
that respect -- though I notice that on my installation, PNG support is
as good if not better than BMP support.

>>  But what about sound files? Does pygame.mixer.music *always*
>>  support Ogg files? I know my installation does.
>>
> SDL_mixer can be built without ogg vorbis support - but I don't see
> why it would be. again, if there is a case where it is, it would be
> good to get that fixed.

There's a(nother?) documentation problem here:

pygame.mixer.music.load makes no mention of what formats can be loaded
in either 1.7 or website documentation. In both cases, though,
pygame.mixer.music.play makes an oblique reference to using MP3, OGG,
and MOD formats:

"""
The starting position is dependent on the format of music playing. MP3
and OGG use the position as time (in seconds). MOD music it is the
pattern order number.
"""

This is the only indication that those formats are supported. It's
unclear whether other formats are supported or whether this support is
unique to the pygame.mixer.music module, or generally applies to all of
pygame.mixer.

The in-package documentation for 1.7.1 mentions only WAV support for
pygame.mixer:

"""
Loads a new sound object from a WAV file.
"""

(it doesn't say it doesn't support OGG, but it doesn't say it does, either).

The website says:
"""
The Sound can be loaded from an OGG audio file or from an uncompressed WAV.
"""

but doesn't say whether the program has changed, or only the
documentation. Is the support for pygame.mixer.Sound different from that
of pygame.mixer.music.load? Can you load MOD files with
pygame.mixer.Sound, for example?

The fact that there are two separate modules for handling sound playback
makes me think that the range of file format support will be different.

In all of the versions I've *tested*, loading an Ogg file worked just
fine with both music.load() and mixer.Sound() (well, nearly -- I did
once have a problem with playback of Sounds when the music module
*wasn't* playing, oddly enough)

>>  Also, one person has complained about installation problems on
>>  Fedora Core and also on OS X. Are there binary bundles that
>>  work well on those platforms? I assume Windows is covered,
>>  and I know the Debian installation "just works".
>>
> I don't know about Fedora, but it's my expectation that OS X prebuilt
> installer support for pygame 1.8 is sufficient for all needs. If there
> is any circumstance where that is not the case, please let the list
> know so it can be fixed.
> 
> Also, OS X support for pygame 1.7 has been lacking in that a prebuilt
> python 2.5 installer was not available for a long period of time,
> which may be where that part of the complaint originated.

Are you saying that the correct instructions for OS X, for v1.7 and v1.8
is now to just use the installer from pygame.org downloads? Are you also
saying that these work with the version of python that ships with OS X?

IOW, the documentation that warned my friend off of just doing a
straight install was outdated?

Thanks for all of the replies! It's one thing to know what works on your
own system (you can always just test), but it's very tricky to work out
what will reliably work with other versions on other platforms and
installations.

Cheers,
Terry

-- 
Terry Hancock ([EMAIL PROTECTED])
Anansi Spaceworks http://www.AnansiSpaceworks.com



Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-31 Thread Ian Mallett
I have had no problems loading .png, .gif, .bmp, or .jpg, and I can
save to .bmp, and I believe also to .jpg, but I'm not sure.


Re: [pygame] Does PyGame support Ogg Vorbis "OOTB"?

2008-03-31 Thread Lenard Lindstrom
I can only speak for Pygame 1.8 on Windows, but I did build it fully 
loaded. According to the SDL_image docs Pygame should read image formats 
"BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF, JPEG, PNG, TGA, and TIFF". 
Pygame can write BMP, TGA, PNG and JPEG (.jpg) files.


On the audio side "SDL_mixer supports playing music and sound samples 
from the following formats:

- WAVE/RIFF (.wav)
- AIFF (.aiff)
- VOC (.voc)
- MOD (.mod .xm .s3m .669 .it .med and more) using included mikmod
- MIDI (.mid) using timidity or native midi hardware
- OggVorbis (.ogg) ...
- MP3 (.mp3)"

To get timidity support unpack the GUS patches, 
http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz , under 
C:\ . This installs a single timidity directory.


Finally, contrary to the documentation, the movie module is available 
for Windows and does works for me. I have played .mpg files with it. 
However, the loop feature was removed.




Lenard


Ian Mallett wrote:

I have had no problems loading .png, .gif, .bmp, or .jpg, and I can
save to .bmp, and I believe also to .jpg, but I'm not sure.