views:

61

answers:

1

I'm working on an audio creation framework. It'll be generating large audio files, say 3 minute long audio files that take about 1 minute to generate. So what I want is a system much like streaming audio from the internet, where I play the sound as I generate it.
Pygame's mixer allows me to edit the sound as it's playing. But I cannot figure out how to change the sample rate, sample size, or number of channels.
Snack allows me to edit sounds, as well as their sample rate, sample size, length, and number of channels. But I cannot figure out how to edit sounds as they are playing.

Could anybody point me to a library that allows me to edit a sound as it is playing, as well as configure the number of channels, sample rate, and length (all known ahead of time)? If not, perhaps somebody knows of a tutorial to do this in C++?

[EDIT] Pymedia.audio would work fine for me. However, I can't get it to work under Python 2.6. Any ideas?

A: 

pymedia.audio does work with Python 2.6. Take a look at this SO post: http://stackoverflow.com/questions/2141701/pymedia-installation-on-windows-with-python-2-6

You can append audio to Output objects, as they are playing. So as each sample is generated, it can also be appended to the stream. The example in their documentation shows just how to do this: http://pymedia.org/docs/pymedia.audio.sound.html

Wallacoloo