Fix speaker
Float division in python3 -> force integer division with //
This commit is contained in:
parent
b717984056
commit
2d6e6f5de6
|
@ -279,7 +279,7 @@ class Speaker:
|
|||
|
||||
def toggle(self, cycle):
|
||||
if self.last_toggle is not None:
|
||||
l = (cycle - self.last_toggle) / Speaker.CPU_CYCLES_PER_SAMPLE
|
||||
l = (cycle - self.last_toggle) // Speaker.CPU_CYCLES_PER_SAMPLE
|
||||
self.buffer.extend([0, 26000] if self.polarity else [0, -2600])
|
||||
self.buffer.extend((l - 2) * [16384] if self.polarity else [-16384])
|
||||
self.polarity = not self.polarity
|
||||
|
|
Loading…
Reference in New Issue