播放 Windows 哔哔声
Windows 提供了一个显式接口,通过该接口,winsound
模块允许你以给定的频率和持续时间播放原始蜂鸣声。
import winsound
freq = 2500 # Set frequency To 2500 Hertz
dur = 1000 # Set duration To 1000 ms == 1 second
winsound.Beep(freq, dur)
Windows 提供了一个显式接口,通过该接口,winsound
模块允许你以给定的频率和持续时间播放原始蜂鸣声。
import winsound
freq = 2500 # Set frequency To 2500 Hertz
dur = 1000 # Set duration To 1000 ms == 1 second
winsound.Beep(freq, dur)