Author drj
Recipients drj, gpolo
Date 2009-02-10.13:09:28
SpamBayes Score 4.34319e-13
Marked as misclassified No
Message-id <>
In-reply-to <>
On 10 Feb 2009, at 12:28, Guilherme Polo wrote:

> Guilherme Polo <> added the comment:
> I'm really unsure about the proposed patch.

Perhaps my example was too trivial.  The point is that if you call  
setnframes then you can get to avoid patching the header; so  
it does not need to seek on the output file.  However, that _still_  
doesn't let you pipe the output, because of the "tell" problem.   
That's what the patch is for.

Here is a (slightly) less trivial example:

#!/usr/bin/env python
import sys
import wave
w =, 'w')
for _ in range(50): w.writeframesraw('\x00\xff')

(The wave file that it outputs is 100ms of 1000 Hz sine wave by the way)

Note the call to setnframes _before_ the data is written.  That's  
what means the header does not need to be patched.  With my patch  
applied the output of this program can be fed to a pipe.

If you remove the call to setnframes then the header will need to be  
patched, and this still (correctly, usefully) raises an error with my  
patch applied.
Date User Action Args
2009-02-10 13:09:30drjsetrecipients: + drj, gpolo
2009-02-10 13:09:29drjlinkissue5202 messages
2009-02-10 13:09:28drjcreate