Commit 5a4fe91c authored by hackEns's avatar hackEns
Browse files

Bug correction in sound4python when one doesn't have numpy installed

parent de7ae02d
......@@ -52,7 +52,12 @@ def sound(itr,samprate=16000,autoscale=True,output=False):
wroteFrames=True
if( not wroteFrames and not foundNumpy ):
#python w/o np doesn't have "short"/"int16", "@h" is "native,aligned short"
waveWrite.writeframes( struct.pack(len(itr)*"@h",[int(mult*itm) for itm in itr]) )
# BAD : waveWrite.writeframes( struct.pack(len(itr)*"@h",[int(mult*itm) for itm in itr]) )
writeValues = []
for itm in itr:
packed_value = struct.pack('h', int(mult*itm))
waveWrite.writeframes(packed_value)
wroteFrames=True
if( not wroteFrames ):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment