Show More
@@ -103,7 +103,7 b' class Audio(DisplayObject):' | |||||
103 | import struct |
|
103 | import struct | |
104 | from io import BytesIO |
|
104 | from io import BytesIO | |
105 | import wave |
|
105 | import wave | |
106 | maxabsvalue = max(map(abs,data)) |
|
106 | maxabsvalue = float(max(map(abs,data))) | |
107 | scaled = map(lambda x: int(x/maxabsvalue*32767), data) |
|
107 | scaled = map(lambda x: int(x/maxabsvalue*32767), data) | |
108 | fp = BytesIO() |
|
108 | fp = BytesIO() | |
109 | waveobj = wave.open(fp,mode='wb') |
|
109 | waveobj = wave.open(fp,mode='wb') |
General Comments 0
You need to be logged in to leave comments.
Login now