Created
May 25, 2025 17:50
-
-
Save jepler/8ed6f77fa587f90b03d40bf58f2b40c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import array | |
import time | |
import math | |
import audiosdl | |
import synthio | |
sine = array.array('h', | |
(int(math.sin(i * 2 * math.pi / 1024) * 32000) for i in range(1024))) | |
print(min(sine), max(sine)) | |
ao = audiosdl.AudioOut(48000) | |
s = synthio.Synthesizer(sample_rate=48000,channel_count=2, | |
waveform=sine, | |
) | |
ao.play(s) | |
s.press(49) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment