Maybe just try a simple wav encoding. Also, if you want do more stuff with audio files and buffers, I recommend checking out the following standard Python packages: wave audioop