[Scipy-svn] r6974 - trunk/scipy/io

scipy-svn@scip... scipy-svn@scip...
Sun Nov 28 17:43:21 CST 2010


Author: ptvirtan
Date: 2010-11-28 17:43:20 -0600 (Sun, 28 Nov 2010)
New Revision: 6974

Modified:
   trunk/scipy/io/wavfile.py
Log:
BUG: io/wavfile: use fixed endianness also in read()

Modified: trunk/scipy/io/wavfile.py
===================================================================
--- trunk/scipy/io/wavfile.py	2010-11-28 23:26:36 UTC (rev 6973)
+++ trunk/scipy/io/wavfile.py	2010-11-28 23:43:20 UTC (rev 6974)
@@ -120,7 +120,11 @@
         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



More information about the Scipy-svn mailing list