From 1218c0a885de88afe323fd910d5f651bbb35b947 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 5 Aug 2026 14:12:56 +0000 Subject: [PATCH] =?UTF-8?q?testSound.py=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testSound.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 testSound.py diff --git a/testSound.py b/testSound.py new file mode 100644 index 0000000..3e1e872 --- /dev/null +++ b/testSound.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 +import time + +from pysinewave import SineWave + +# Create a sine wave, with a starting pitch of 12, and a pitch change speed of 10/second. +sinewave = SineWave(pitch = 12, pitch_per_second = 5) +# Turn the sine wave on. +sinewave.play() + +# Sleep for 2 seconds, as the sinewave keeps playing. +time.sleep(2) + +while True: + + # Set the goal pitch to -5. + sinewave.set_pitch(-5) + + # Sleep for 3 seconds, as the sinewave smoothly slides its pitch down from 12 to -5, and stays there. + time.sleep(1) + + + # Set the goal pitch to -5. + sinewave.set_pitch(12) + + # Sleep for 3 seconds, as the sinewave smoothly slides its pitch down from 12 to -5, and stays there. + time.sleep(1)