isine example: actually play some tones

the thread in the background actually needs time to do something
sensible. this is most easily achieved by simply sleeping in the
foreground thread.

i addition to the 440 Hz tone, also play 1 kHz, to demonstrate how
the change() function is used.
This commit is contained in:
Oswald Buddenhagen
2024-02-01 21:07:49 +01:00
parent 2f74e8e8a4
commit eb51d11619

View File

@@ -7,6 +7,7 @@
from __future__ import print_function
import sys
import time
from threading import Thread
from multiprocessing import Queue
@@ -87,6 +88,7 @@ class SinePlayer(Thread):
isine = SinePlayer()
isine.start()
def change(f):
isine.change(f)
time.sleep(1)
isine.change(1000)
time.sleep(1)