commit 1218c0a885de88afe323fd910d5f651bbb35b947 Author: admin Date: Wed Aug 5 14:12:56 2026 +0000 testSound.py hinzugefügt 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)