From eb51d1161959df6b8b7eafd5504cbd27af855fa7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 1 Feb 2024 21:07:49 +0100 Subject: [PATCH] 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. --- isine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/isine.py b/isine.py index dc2d7e8..7cd865b 100644 --- a/isine.py +++ b/isine.py @@ -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) +