Guilherme Polo <ggp...@gmail.com> added the comment: Aren't 8 bit samples stored as unsigned bytes ? If yes, they don't range between -128 and 127 (first disagreement). So this line: wav = [ s - 128 for s in wav ] and the respective one (that adds +128 in writesamples) should go.
Why is this check: "if len(wavs) not in [ 1, 2, 4 ]" needed ? Calling setnchannels inside writesamples looks very wrong to me, weren't you going to writesamples ? Then why is it modified the number of channels ? The caller should be responsible for calling setnchannels, besides, what is the use of calling setnchannels here ? I see writesamples is expecting "wavs" to be a list of lists containing integers, is that the best format to expect ? writeframes works with strings (which are actually byte strings). The code layout didn't help me to get in agreement with it either. The above paragraphs are the things I disagree with the patch, hopefully you can help on those questions. Also, it would be better to hand write the wave file for testing so we can be sure about its content without needing much analysis. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4913> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com