[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Alex Robinson
Alex Robinson added the comment: Oh gob. I left a debug artifact in that code. wavs= [ wavs, wv ] needs to be without the 'wv'. ___ Python tracker ___ __

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Alex Robinson
Alex Robinson added the comment: Oh golly. I was confused. For some reason I was thinking "writesamples()" when using "writeframes()". So the current code reads ok. Which makes this "bug" a request for writesamples() and readsamples() to be added to wave.py. They would shield sleep deprived sap

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Guilherme Polo
Guilherme Polo added the comment: Ah, yes :) But in the other case (the one where it is currently multiplied) the multiplication happens because data is formatted to either bytes, shorts or longs, so without the multiplication data length would end up being divided by 1, 2 or 4. So, besides the

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Guilherme Polo
Guilherme Polo added the comment: Given the name of the function related to the problem: "writeframesraw", it seems to be more correct to remove the sampwidth multiplication from the other case (not add it in the other one), since you must already pass the data multiplied by it. Does that make

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Guilherme Polo
Changes by Guilherme Polo : Removed file: http://bugs.python.org/file12688/issue_4913.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Guilherme Polo
Guilherme Polo added the comment: Oops, _framesize already takes sampwidth into account. So there is a problem somewhere else, since reading the wave file is returning the number of frames multiplied by the sampwidth. ___ Python tracker

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-11 Thread Guilherme Polo
Guilherme Polo added the comment: Wave_read.initfp also needs fixing on counting the frame number, correct me if its wrong. Patch added. -- keywords: +patch nosy: +gpolo Added file: http://bugs.python.org/file12688/issue_4913.diff ___ Python tracker

[issue4913] wave.py writes 16 bit sample files of half the correct duration

2009-01-10 Thread Alex Robinson
New submission from Alex Robinson : Corrected code in writeframesraw(): self._datawritten = self._datawritten + len(data) * self._sampwidth else: self._file.write(data) self._datawritten = self._datawritten + len(data) * self._sampwidth Note that the