Skip to content

Commit

Permalink
Compatibility with v2024 - wasapi play is now synchronous, so need to…
Browse files Browse the repository at this point in the history
… run in another thread
  • Loading branch information
mltony committed Apr 12, 2024
1 parent 7e6aea1 commit f4d35c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/globalPlugins/browserNav/beeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def fancyCrackle(self, levels, volume, initialDelay=0):
self.getPitch(l), beepLen, volume, volume)
bufPtr += pauseBufSize # add a short pause
self.player.stop()
self.player.feed(buf.raw)
threading.Thread(target=lambda:self.player.feed(buf.raw)).start()

def simpleCrackle(self, n, volume, initialDelay=0):
return self.fancyCrackle([0] * n, volume, initialDelay=initialDelay)
Expand Down Expand Up @@ -108,7 +108,7 @@ def fancyBeep(self, chord, length, left=10, right=10):
maxInt = 1 << (8 * intSize)
result = map(lambda x : x %maxInt, result)
packed = struct.pack("<%dQ" % (bufSize // intSize), *result)
self.player.feed(packed)
threading.Thread(target=lambda:self.player.feed(packed)).start()

def uniformSample(self, a, m):
n = len(a)
Expand Down

0 comments on commit f4d35c4

Please sign in to comment.