Skip to content

Commit

Permalink
BUG: io/wavfile: use fixed endianness also in read()
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Nov 28, 2010
1 parent 3076be6 commit 5ca9c3c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scipy/io/wavfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ def read(file):
else:
warnings.warn("chunk not understood", WavFileWarning)
data = fid.read(4)
size = struct.unpack('I',data)[0]
if _big_endian:
fmt = '>i'
else:
fmt = '<i'
size = struct.unpack(fmt, data)[0]
fid.seek(size, 1)
fid.close()
return rate, data
Expand Down

0 comments on commit 5ca9c3c

Please sign in to comment.