On 2010-01-08, Robert Somerville <rsomervi...@sjgeophysics.com> wrote:

> I am trying to read 24bit signed WAV format (little endian) data from a 
> WAV file and convert it to 32 bit little endian integer format ... can 
> anybody please tell me how to do the conversion from 24 bit to 32 bit 
> with a snippet of Python code ???

def sext24(d):
    if ord(d[2]) & 0x80:
        return d+'\xff'
    else:
        return d+'\x00'
        
-- 
Grant Edwards                   grante             Yow! Am I having fun yet?
                                  at               
                               visi.com            
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to