播放 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)