[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] How to play a sound from a "file" of infinite size?



On Tue, 2006-02-07 at 19:06 +0100, Tomasz Primke wrote:
> First: the file format, that the C library decodes, requires a lot of 
> processing - therefore the idea to make samples in pure C and then to wrap 
> it all with Python (e.g. with Pyrex) sounds... reasonable. But it will be 
> the last resort. My philosophy of programming is to use Python as long, as 
> it's fast enough; then use Pyrex as long, as it's fast enough; and as the 
> last resort, use C.

I'd go with C then for the audio decoding and streaming.
As for sharing SDL_mixer with a running Pygame process, you shouldn't
run into any troubles. You can run your program as a regular pygame
process. You'll need a small python binary module with your decoder and
a function you can call from python to get it registered.

Once this is running it should be easy to run your program normally,
even play sound effects. But still play your music on the streaming
music channel.