diff options
author | Anthony Wang | 2022-10-03 17:54:32 -0400 |
---|---|---|
committer | Anthony Wang | 2022-10-03 17:54:32 -0400 |
commit | ef083f3740516570e64112ed0aa6bb8220a88604 (patch) | |
tree | e9b380e238e7c1d4d35183a0dee96bc8ca063490 /beepemu | |
parent | 62ceacf10980ef96b1a227d76cdf3e7db82fd4de (diff) |
Use pysinewave (terrible library :(((()))))
Diffstat (limited to 'beepemu')
-rwxr-xr-x | beepemu | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +#!/usr/bin/python + +import math +import sys +import time +from pysinewave import SineWave + +i = 1 +f = 0 +l = 0 +while i < len(sys.argv): + if sys.argv[i] == '-f': + i += 1 + f = float(sys.argv[i]) + elif sys.argv[i] == '-l': + i += 1 + l = float(sys.argv[i])/1000 + elif sys.argv[i] == '-D': + i += 1 + time.sleep(float(sys.argv[i])/1000) + if f != 0 and l != 0: + print(f, l) + s = SineWave(pitch_per_second=1000) + s.set_frequency(f) + s.play() + time.sleep(l) + s.stop() + f = 0 + l = 0 + i += 1 |