Files
cursor-flasher/src/cursor_flasher/sound.py
cottongin 3cbe529b7a feat: add system sound alert module
Made-with: Cursor
2026-03-10 02:44:45 -04:00

18 lines
390 B
Python

"""System sound playback."""
from Cocoa import NSSound
from cursor_flasher.config import Config
def play_alert(config: Config) -> None:
"""Play the configured alert sound if enabled."""
if not config.sound_enabled:
return
sound = NSSound.soundNamed_(config.sound_name)
if sound is None:
return
sound.setVolume_(config.sound_volume)
sound.play()