Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help: Crossplattform audio functionality in Python

2 views
Skip to first unread message

Olov Johansson

unread,
Oct 11, 2001, 11:03:37 AM10/11/01
to
Hello all,
I recently had my first serious look at Python and like it for many reasons.
I'm trying to get a grip on it's capabilities and limits and as a result of
that..:

How is the crossplatform sound support? From what I found in the
documentation (2.1.1) there is Al (SGI), sunaudiodev (SunOS) and winsound
(win32 and very limited). I want something that gives me a soundbuffer I can
write to, and I'd like it to work on at least Linux (OSS/ALSA) and Windows.

Are there any plans for implementing a crossplatform audio library in future
versions of python? Can i contribute by making windows-versions of available
libraries, or is someone working on that already? Perhaps extending libao
and including it into python would be a good idea? writing win32 and mac
compatibility to libao should be easy and i could provide at least win32 if
needed.


Thanks,
Olov Johansson
sweden

Gerhard Häring

unread,
Oct 11, 2001, 11:37:20 AM10/11/01
to pytho...@python.org
On Thu, Oct 11, 2001 at 03:03:37PM +0000, Olov Johansson wrote:
> Hello all,
> I recently had my first serious look at Python and like it for many reasons.
> I'm trying to get a grip on it's capabilities and limits and as a result of
> that..:
>
> How is the crossplatform sound support? From what I found in the
> documentation (2.1.1) there is Al (SGI), sunaudiodev (SunOS) and winsound
> (win32 and very limited). I want something that gives me a soundbuffer I can
> write to, and I'd like it to work on at least Linux (OSS/ALSA) and Windows.
> [...]

pygame (http://www.pygame.org/) contains a sound library that works on
*nix and Windows. It is based on several SDL libraries, so for
cross-platform sound only, it might be overkill. But it's cool stuff
nevertheless.

Gerhard
--
mail: gerhard <at> bigfoot <dot> de registered Linux user #64239
web: http://www.cs.fhm.edu/~ifw00065/ OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

Olov Johansson

unread,
Oct 11, 2001, 1:48:34 PM10/11/01
to
"Gerhard Häring" <gh_pyt...@gmx.de> wrote in message
news:mailman.1002814696...@python.org...

> pygame (http://www.pygame.org/) contains a sound library that works on
> *nix and Windows. It is based on several SDL libraries, so for
> cross-platform sound only, it might be overkill. But it's cool stuff
> nevertheless.

I went straight to libsdl.org instead and downloaded their SDL 1.2.2
sources. They have, indeed, a crossplatform sound system (covering unix'es,
mac and win32). Just compiling the soundsystem into a lib and writing a
python interface for it should be quite easy. It's licensed under LGPL. I
talked about libao previously, I checked that out again and it seems like
there is some windows support i the cvs at least, libao is licensed under
GPL.

Both these libraries would suit my needs (libao would be the easiest to use
because the python stuff is already written afaik), but in the longer term..
The Python core needs (imho) a builtin soundsystem which works on all
platforms. Java has had this (though poorly implemented) from the beginning
i think. I realize that neither libao nor libsdl could make it into the
Python core because of their licenses (or could they?) - therefor I hope
that there is some kind of initiative going on somewhere to make Python a
bit more soundish! I would (as said) be happy to contribute to this if
needed but really need to know how to :)


Thanks,
Olov Johansson
sweden

Paul Winkler

unread,
Oct 11, 2001, 3:58:20 PM10/11/01
to
On Thu, 11 Oct 2001 17:48:34 GMT, Olov Johansson
<olov_johansso...@mail.ru> wrote:

>Both these libraries would suit my needs (libao would be the easiest to use
>because the python stuff is already written afaik), but in the longer term..
>The Python core needs (imho) a builtin soundsystem which works on all
>platforms.

I agree. It's scattered across various modules - e.g. al for SGI,
sunaudiodev for Sun, and they have different interfaces.

Another option, though no python bindings exist yet: Portaudio,
see http://www.portaudio.com

--PW

Ignacio Vazquez-Abrams

unread,
Oct 11, 2001, 4:17:26 PM10/11/01
to pytho...@python.org
On Thu, 11 Oct 2001, Paul Winkler wrote:

> Another option, though no python bindings exist yet: Portaudio,
> see http://www.portaudio.com

libao supports more audio platforms than PortAudio as-is, and ao-python
(Python bindings for libao) exists already.

--
Ignacio Vazquez-Abrams <ign...@openservices.net>

"As far as I can tell / It doesn't matter who you are /
If you can believe there's something worth fighting for."
- "Parade", Garbage


Olov Johansson

unread,
Oct 11, 2001, 7:22:07 PM10/11/01
to
"Paul Winkler" <slin...@yahoo.com> wrote in message
news:slrn9sbueh....@roaddog.armsnet...


> Another option, though no python bindings exist yet: Portaudio,
> see http://www.portaudio.com

the site appeared to be down when i tried that url.. anyways, to sum it up:
there are severeal potential crossplatform sound libraries which would suit
python just fine. among them are libao (gpl), libsdl (lgpl), mpg123 output
routines (gpl), portaudio(?). writing python bindings for any of these
should be no problem, but it needs to be integrated into the python core
before it's really useable (to easen up things for users).


/olov

Paul Winkler

unread,
Oct 12, 2001, 2:32:53 AM10/12/01
to
On Thu, 11 Oct 2001 23:22:07 GMT, Olov Johansson
<olov_johansso...@mail.ru> wrote:

>"Paul Winkler" <slin...@yahoo.com> wrote in message
>news:slrn9sbueh....@roaddog.armsnet...
>
>
>> Another option, though no python bindings exist yet: Portaudio,
>> see http://www.portaudio.com
>
>the site appeared to be down when i tried that url.. anyways, to sum it up:
>there are severeal potential crossplatform sound libraries which would suit
>python just fine. among them are libao (gpl), libsdl (lgpl), mpg123 output
>routines (gpl), portaudio(?).

The Portaudio license is very permissive - it's of the "you can do
anything except sue me" variety.

>writing python bindings for any of these
>should be no problem, but it needs to be integrated into the python core
>before it's really useable (to easen up things for users).

That would be nice, but I suspect the core team would see it as bloat.

--PW

0 new messages