py工具可使用各种各样的库
话不多说上代码
import random
import winsound
while True:
x = random.randint(300, 1000)
for __count in range(6):
# 频率,单位为赫兹
frequency = x
# 持续时间 单位为毫秒
duration = (1 * 500)
winsound.Beep(frequency, duration)