mirror of
https://github.com/larsimmisch/pyalsaaudio.git
synced 2026-04-18 08:55:31 +00:00
isine example: fix use of deprecated Thread.setDaemon()
This commit is contained in:
3
isine.py
3
isine.py
@@ -54,8 +54,7 @@ def generate(frequency, duration = 0.125):
|
|||||||
class SinePlayer(Thread):
|
class SinePlayer(Thread):
|
||||||
|
|
||||||
def __init__(self, frequency = 440.0):
|
def __init__(self, frequency = 440.0):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self, daemon=True)
|
||||||
self.setDaemon(True)
|
|
||||||
self.device = alsaaudio.PCM(channels=channels, format=format, rate=sampling_rate)
|
self.device = alsaaudio.PCM(channels=channels, format=format, rate=sampling_rate)
|
||||||
self.queue = Queue()
|
self.queue = Queue()
|
||||||
self.change(frequency)
|
self.change(frequency)
|
||||||
|
|||||||
Reference in New Issue
Block a user