[Patches] [ python-Patches-1373643 ] chunk.py can't handle >2GB chunks

SourceForge.net noreply at sourceforge.net
Mon Dec 5 17:42:45 CET 2005


Patches item #1373643, was opened at 2005-12-05 17:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1373643&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Christer Weinigel (wingel)
Assigned to: Nobody/Anonymous (nobody)
Summary: chunk.py can't handle >2GB chunks

Initial Comment:
chunk.py unpacks the chunk size as a signed long 'l'
not as unsigned long 'L' which is what it ought to do
according to the WAV specs.  Additionally, since field
contains a byte count it makes no sense for it to be
signed.

What I want to do is to read a wave file generated by
madplay on the fly.  Since madplay doesn't know the
size of the WAVE chunk when it is written, it sets the
chunk size to 0xffff which is inpreted as -1 by
chunk.py .  Changing chunk.py to read it as an unsigned
long makes this work.

Example code:

import wave
import os

f = os.popen('madplay -o wave:- foo.mp3')
wf = wave.open(f, 'rb')

Without a patch, this will raise an error:

wave.Error: not a WAVE file




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1373643&group_id=5470


More information about the Patches mailing list